2016-01-05 18:53
浏览 79

如何通过git push以私有存储库作为依赖项部署Azure Go Web应用程序?

What would be the proper way to deploy a Go app to Azure that have private GitHub repositories as dependencies? Here's the current error from Kudu:

Resolving dependencies
# cd .; git clone
Cloning into 'D:\local\Temp\8d315fa89272e69\gopath\src\\my\privaterepo'...
fatal: could not read Username for '': Bad file descriptor
package exit status 128
package cannot find package $GOROOT)

Building Go app to produce exe file
azureapp\file.go:8:2: cannot find package "" 
in any of:
    D:\Program Files\Go\1.5.1\src\\my\privaterepo\pkg1 (from $GOROOT)

I was previously deploying via FTP with web.config's HttpPlatformHandler entry. But using git push is quicker especially for non-Windows team members.


图片转代码服务由CSDN问答提供 功能建议

将具有私有GitHub存储库作为依赖项的Go应用程序部署到Azure的正确方法是什么? 这是来自Kudu的当前错误:

#cd。  git clone
 D:\ local \ Temp \ 8d315fa89272e69 \ gopath \ src \ \ my \ privaterepo 
克隆到'D:\ local \ Temp \ 8d315fa89272e69 \ gopath \  src \ \ my \ privaterepo'... 
package退出状态128 \  npackage找不到软件包$ GOROOT)
azureapp \ file.go:8:2:找不到软件包“  pkg1“ 
 D:\ Program Files \ Go \ 1.5.1 \ src \ \ my \ privaterepo \ pkg1(来自$ GOROOT)
 \  n 

我以前曾通过FTP使用 web.config 的HttpPlatformHandler条目进行部署。 但是使用git push更快,特别是对于非Windows团队成员。


  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanmeng3476 2016-01-07 10:22

    As @Not_a_Golfer and @Xiaomin said, vendoring the dependencies worked, here's what I did:

    1. Turned the env variable on locally GO15VENDOREXPERIMENT=1
    2. Installed godep => go get
    3. Making sure your app is passing a go build & go test
    4. Ran godep save this copied all dependencies to ./vendor
    5. On my Azure web app, I also set the environment variable GO15VENDOREXPERIMENT=1
    6. git pushed and voila.

    At first I did not set the environment variable on my Azure app, so the dependency resolver was not looking in ./vendor, turning it to 1 fixed everything.

    打赏 评论

相关推荐 更多相似问题