Created
November 29, 2019 02:30
-
-
Save manakuro/cd0b4a071c20c89ba0253e06c239698a to your computer and use it in GitHub Desktop.
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
version: 2.1 | |
orbs: | |
gcp-cli: circleci/[email protected] | |
executors: | |
default: | |
docker: | |
- image: google/cloud-sdk | |
working_directory: go/src/github.com/manakuro/golang-deploy-gcp | |
jobs: | |
build: | |
executor: | |
name: default | |
steps: | |
- checkout | |
- setup_remote_docker: | |
version: 18.06.0-ce | |
- gcp-cli/initialize | |
- gcp-cli/install | |
- run: | |
name: Push image to GCR | |
command: | | |
gcloud --quiet auth configure-docker | |
docker build -t golang-deploy-gcp . | |
today=$(date "+%Y%m%d%H%M%S") | |
TAG=gcr.io/golang-deploy-gcp/golang-deploy-gcp:${today} | |
docker tag golang-deploy-gcp $TAG | |
docker push $TAG | |
LATEST_TAG=gcr.io/golang-deploy-gcp/golang-deploy-gcp:latest | |
docker tag golang-deploy-gcp $LATEST_TAG | |
docker push $LATEST_TAG | |
workflows: | |
deploy_gcr: | |
jobs: | |
- build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment