Google Container Builder: How to install govendor dependencies during build step?

半腔热情 提交于 2019-12-12 04:08:56

问题


I am trying to use Google Cloud Container Builder to automate the building of my containers using GCP Build Triggers

My code is in Go, and I have a vendor folder in my project root which contains all of my Go dependencies (I use govendor). However, this vendor folder is NOT checked in to source control.

I have a cloudbuild.yaml file where I first build my Go source into a main executable, and then build a Docker image using this executable. Container Builder ensures these build steps have access to my master branch.

The problem is that the Go compilation step fails, because the vendor folder is not checked in to source control, so none of my dependencies are available for any build step.

Is there a way to create a build step that uses govendor to install all dependencies in the vendor folder? If so, how? Or is the only option to check in my vendor directory into source control (which seems unnecessary to me)?


回答1:


As per @JimB and @Peter's comments to my question, an easy solution is to add my vendor directory to Git so I don't have to download all my dependencies during the build steps.



来源:https://stackoverflow.com/questions/46395187/google-container-builder-how-to-install-govendor-dependencies-during-build-step

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!