Last active
January 11, 2022 09:29
-
-
Save fawix/9d409ebb22d280dda4eb81ce29c065bb to your computer and use it in GitHub Desktop.
translate/cloudbuild.yaml
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
# Licensing CC BY-SA 4.0 | |
Steps: | |
# CI Pipeline: static tests | |
- id: 'app-hana-be: static tests' | |
name: 'gcr.io/$PROJECTID/be-build-env' | |
waitFor: ['-'] | |
dir: translate | |
args: | |
- -c | |
- > | |
echo "running: go vet -v" && | |
go vet -v | |
# CI Pipeline: unit + functional tests | |
- id: 'app-hana-be: unit tests' | |
name: 'gcr.io/$PROJECTID/be-build-env' | |
waitFor: ['app-hana-be: static tests'] | |
dir: translate | |
args: | |
- -c | |
- > | |
echo "running go test -v" && | |
go test -v | |
# CI Pipeline: static tests | |
- id: 'app-hana-be: build container' | |
name: 'gcr.io/cloud-builders/docker' | |
waitFor: | |
- 'app-hana-be: static tests' | |
- 'app-hana-be: unit tests' | |
dir: translate | |
args: ['build', '-t', 'gcr.io/$PROJECTID/app-hana-be-cicd', '.'] | |
# CD Pipeline: push container to GCR | |
- id: 'app-hana-be: push container' | |
name: 'gcr.io/cloud-builders/docker' | |
waitFor: | |
- 'app-hana-be: build container' | |
dir: translate | |
args: ['push', 'gcr.io/$PROJECTID/app-hana-be'] | |
# CD Pipeline: deploy to Cloud Run | |
- id: 'app-hana-be: deploy container' | |
name: 'gcr.io/cloud-builders/gcloud' | |
waitFor: | |
- 'app-hana-be: push container' | |
dir: translate | |
args: | |
- 'run' | |
- 'deploy' | |
- 'app-hana-be-cicd' | |
- '--image' | |
- 'gcr.io/$PROJECTID/app-hana-be' | |
- '--region' | |
- 'us-central1' | |
- '--platform' | |
- 'managed' | |
- '--allow-unauthenticated' | |
# CI Pipeline: integration tests would go here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment