donglian5309 2016-01-05 18:53
浏览 89
已采纳

如何通过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 https://github.com/my/privaterepo
  D:\local\Temp\8d315fa89272e69\gopath\src\github.com\my\privaterepo
Cloning into 'D:\local\Temp\8d315fa89272e69\gopath\src\github.com\my\privaterepo'...
fatal: could not read Username for 'https://github.com': Bad file descriptor
package github.com/my/privaterepo/pkg1: exit status 128
package github.com/my/privaterepo/pkg2: cannot find package $GOROOT)

Building Go app to produce exe file
azureapp\file.go:8:2: cannot find package "github.com/my/privaterepo/pkg1" 
in any of:
    D:\Program Files\Go\1.5.1\src\github.com\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.

Thanks

  • 写回答

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 github.com/tools/godep
    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 MATLAB代码补全插值
  • ¥15 Typegoose 中如何使用 arrayFilters 筛选并更新深度嵌套的子文档数组信息
  • ¥15 前后端分离的学习疑问?
  • ¥15 stata实证代码答疑
  • ¥50 husky+jaco2实现在gazebo与rviz中联合仿真
  • ¥15 dpabi预处理报错:Error using y_ExtractROISignal (line 251)
  • ¥15 在虚拟机中配置flume,无法将slave1节点的文件采集到master节点中
  • ¥15 husky+kinova jaco2 仿真
  • ¥15 zigbee终端设备入网失败
  • ¥15 金融监管系统怎么对7+4机构进行监管的