droe9376 2016-05-18 09:13
浏览 19
已采纳

使用Docker进行Quick Go项目构建,无需检入供应商库

Currently, we have all vendored libraries in src/vendor which makes docker-compose build quite fast. Although adding vendored libraries to source control has the disavantage of libraries not being updated and also heavily polluting the diff of pull requests.

Is there a way in between, maybe with caching?

  • 写回答

1条回答 默认 最新

  • doumi2106 2016-05-18 17:39
    关注

    Is there a way in between, maybe with caching?

    Yes, several. But don't fight the system/preferred method.

    Use $GOPATH/src/MyProject/vendor like you are already doing.

    adding vendored libraries to source control has the disavantage of libraries not being updated...

    That all depends on your team's management of your repo. If everyone ignores the vendor, ya it will get stale.

    Personally I make it a "1st of the month" habit of going through and refreshing all dependencies, running our test suites, and if no errors update for QA integration testing on the dev server and keep an eye on the error logs after release. Tools like godep and gostatus greatly help keep your GOPATH in chrcn with latest, that you can update your vendor folder(s) with quickly.

    Just make sure it is a dedicated commit, so it can be reverted in a hurry if an issue creeps up.

    also heavily polluting the diff of pull requests

    First of all, that's just a process task. I enforce rebasing on all pull requests and reject all merges in all repos. This keeps a very clean git history; but, more to the point, rebasing moves your local commits until after the vendor updates. Shouldn't ever get a conflict unless someone added the same package. Which at that point is easy, just take the latest one and be done.

    Sound like there are process issues to work out than worrying about /vendor management.

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

报告相同问题?

悬赏问题

  • ¥85 maple软件,solve求反函数,出现rootof怎么办?
  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上