This repository has been archived by the owner on Sep 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from chuckha/manual-release
Manual release of container images
- Loading branch information
Showing
3 changed files
with
45 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,49 +1,16 @@ | ||
workflow "Release" { | ||
on = "push" | ||
resolves = ["push images"] | ||
} | ||
|
||
action "Setup Google Cloud" { | ||
uses = "actions/gcloud/auth@master" | ||
secrets = ["GCLOUD_AUTH"] | ||
resolves = ["goreleaser"] | ||
} | ||
|
||
action "is-tag" { | ||
uses = "actions/bin/filter@master" | ||
args = "tag" | ||
} | ||
|
||
action "Set Credential Helper for Docker" { | ||
needs = ["Setup Google Cloud"] | ||
uses = "actions/gcloud/cli@master" | ||
args = ["auth", "configure-docker", "--quiet"] | ||
} | ||
|
||
action "goreleaser" { | ||
uses = "docker://goreleaser/goreleaser" | ||
secrets = ["GORELEASER_GITHUB_TOKEN"] | ||
args = "release" | ||
needs = ["is-tag"] | ||
} | ||
|
||
action "docker build" { | ||
uses = "actions/docker/cli@master" | ||
args = "build -t capd-manager ." | ||
needs = ["goreleaser"] | ||
} | ||
|
||
action "tag images" { | ||
uses = "actions/docker/tag@master" | ||
args = "capd-manager gcr.io/kubernetes1-226021/capd-manager" | ||
needs = ["docker build"] | ||
} | ||
|
||
action "push images" { | ||
uses = "actions/docker/cli@master" | ||
runs = "sh -c" | ||
env = { | ||
IMAGE_NAME = "gcr.io/kubernetes1-226021/capd-manager" | ||
} | ||
args = ["source $HOME/.profile && docker push $IMAGE_NAME:latest && docker push $IMAGE_NAME:$IMAGE_REF && docker push $IMAGE_NAME:$IMAGE_SHA && docker push $IMAGE_NAME:$IMAGE_VERSION"] | ||
needs = ["tag images", "Set Credential Helper for Docker"] | ||
} |
This file contains 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
This file contains 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,30 @@ | ||
# Creating a release | ||
|
||
Tag the repository with the version you want | ||
|
||
`git tag -a v0.1.2 -m 'a patch release'` | ||
|
||
then push the tag | ||
|
||
`git push origin refs/tags/v0.1.2` | ||
|
||
Github actions will take care of the rest. | ||
|
||
Please edit the generated change log. | ||
|
||
## Container Images | ||
|
||
Container images must be pushed from your local machine. | ||
|
||
### via Goreleaser | ||
|
||
If you have [goreleaser](https://goreleaser.com/) installed you can run | ||
`goreleaser --skip-publish` and push the generated images. | ||
|
||
### manually | ||
|
||
Manually build the Dockerfile using `docker build`. The tag pattern is: | ||
|
||
* `:latest` - This is the latest release | ||
* `:<major>.<minor>` - This is the latest minor release in the series | ||
* `:<major>.<minor>.<patch>` - This is the specific version |