-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Cloud Build builder #874
Conversation
dgageot
commented
Aug 4, 2018
- Use "Cloud Build" name everywhere
- Make timeout configurable
- Improve build args handling
- Make docker image configurable
d735aea
to
2d7d5b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nits + ask for a testcase
deploy/cloudbuild.yaml
Outdated
@@ -1,4 +1,4 @@ | |||
# using default substitutions, provided by Google Container Builder | |||
# using default substitutions, provided by Google Clodu Build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloud?
examples/annotated-skaffold.yaml
Outdated
# to be provided and the currently logged user should be given permissions to trigger | ||
# new builds on GCB. | ||
# | ||
# new builds on Cloud Builder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build?
@@ -92,8 +83,10 @@ func (b *Builder) buildArtifact(ctx context.Context, out io.Writer, tagger tag.T | |||
return "", errors.Wrap(err, "uploading source tarball") | |||
} | |||
|
|||
args := append([]string{"build", "--tag", artifact.ImageName, "-f", artifact.DockerArtifact.DockerfilePath}, buildArgs...) | |||
args := append([]string{"build", "--tag", artifact.ImageName, "-f", artifact.DockerArtifact.DockerfilePath}) | |||
args = append(args, docker.GetBuildArgs(artifact.DockerArtifact)...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! so this is basically a bugfix besides being a dedupe, right? docker.GetBuildArgs
handles the "single" build args, while this code above was assuming all buildargs were key-value type. Can we cover this with a testcase? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I added a test.
@balopat Should be good now |
2731c67
to
b45443f
Compare
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Also remove some code duplication Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Codecov Report
@@ Coverage Diff @@
## master #874 +/- ##
=========================================
+ Coverage 37.48% 38.38% +0.9%
=========================================
Files 54 54
Lines 2521 2519 -2
=========================================
+ Hits 945 967 +22
+ Misses 1465 1441 -24
Partials 111 111
Continue to review full report at Codecov.
|