This repository was archived by the owner on Mar 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 237
Add a cloudbuild.yaml trigger for container-diff releases. #125
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Dockerfile used to build a build step that builds container-diff in CI. | ||
FROM golang:1.9 | ||
RUN apt-get update && apt-get install make | ||
RUN mkdir -p /go/src/github.com/GoogleCloudPlatform/ | ||
RUN ln -s /workspace /go/src/github.com/GoogleCloudPlatform/container-diff | ||
WORKDIR /go/src/github.com/GoogleCloudPlatform/container-diff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
steps: | ||
# Build the container that will do the go build. | ||
- name: 'gcr.io/cloud-builders/docker' | ||
args: ['build', '-t', 'builder', '-f', 'Dockerfile.build', '.'] | ||
# Do the go build. | ||
- name: 'builder' | ||
args: ['make', 'cross'] | ||
# Upload to GCS. | ||
- name: 'gcr.io/cloud-builders/gsutil' | ||
args: ['cp', '-r', 'out/*', 'gs://container-diff/builds/$COMMIT_SHA/'] | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Might be worthwhile to have a tag-watcher cloudbuild too?
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.
Sorry, what's a tag-watcher?
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.
Lol sorry - "trigger" was the word I was looking for. Not sure where I got "tag-watcher"
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.
Still not following... :)
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.
My plan was to submit this then setup a trigger in the UI to run this for every commit to master. Is that what you're asking for?
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.
I was just suggesting that you add another cloudbuild.yaml using the same dockerfile, but triggered only when new tags are pushed (instead of every commit), with the step being slightly different:
args: ['cp', '-r', 'out/*', 'gs://container-diff/releases/$TAG_NAME/']
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.
I think thats what @nkubala was planning to do eventually?
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.
yeah I think we had originally talked about adding that. that way we can have the actual releases automated for us as well, as soon as the Github release gets published we get the binaries uploaded to the correct directories. we might also consider adding a
args: ['cp', '-r', 'out/*', 'gs://container-diff/releases/latest/']
to that cloudbuild (to release the newest tag as
latest
), though we might want to have that in a different job so we can do rollbacks easily.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.
Ah, yeah. I was thinking we'd have a separate release job to tag "latest" here.