Remove the creation of a complex cloudbuild.yaml when a simpler Dockerfile suffices. - #799
Conversation
Codecov Report
@@ Coverage Diff @@
## master #799 +/- ##
==========================================
+ Coverage 10.46% 10.47% +<.01%
==========================================
Files 496 496
Lines 12130 12124 -6
==========================================
Hits 1270 1270
+ Misses 10860 10854 -6
Continue to review full report at Codecov.
|
| imageName: options.DeploymentName, | ||
| imageVersion: options.DeploymentVersion, | ||
| buildFilePath: buildFilePath); | ||
| imageVersion: options.DeploymentVersion); |
There was a problem hiding this comment.
Since every parameter to GetImageTag() is found in options, would it be better to move the function into class DeploymentOptions itself?
string imageTag = options.ImageTag;
or
string imageTag = options.GetImageTag();
That would also let you get rid of class CloudBuilderUtils entirely.
There was a problem hiding this comment.
Actually I want to keep it separate because that way creating a Docker image is not only related to GKE. I am in fact working on a private change at the moment where I need this code shared as it is, because I am just building docker images out of the project.
|
PTAL |
When we build a Docker image to be deployed to GKE we create a
cloudbuild.yamlfile that only builds the image by invokingdocker buildon the existingDockerfile. As it turns outgcloudalready supports this directly. Instead of generating thecloudbuild.yamlwe can invokegcloudlike this:gcloud container builds submit --tag={name of the tag} {path to the published app}This will accomplish the same, building the Docker image for the app, with less complexity.
Fixes #591