Created
April 6, 2020 04:14
-
-
Save seahrh/23ffc35d20e4c2973e64fe07df68f582 to your computer and use it in GitHub Desktop.
cloudbuild cicd single pipeline: test, build, deploy
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
steps: | |
- id: 'tests' | |
name: 'python:3.7-slim-buster' | |
args: ['bash', './scripts/tests.sh'] | |
- id: 'build' | |
name: 'gcr.io/cloud-builders/docker' | |
args: ['build', '-t', '${_IMAGE_NAME}:${BRANCH_NAME}', '.'] | |
- id: 'push' | |
name: 'gcr.io/cloud-builders/docker' | |
args: ['push', '${_IMAGE_NAME}:${BRANCH_NAME}'] | |
- id: 'deploy' | |
name: 'asia.gcr.io/my_gcp_project/helm:2.10.0' | |
entrypoint: 'sh' | |
args: ['./scripts/install.sh'] | |
env: | |
- 'ENVIRONMENT=${_ENVIRONMENT}' | |
- 'IMAGE_NAME=${_IMAGE_NAME}' | |
- 'IMAGE_TAG=${BRANCH_NAME}' | |
- 'NAMESPACE=${_NAMESPACE}' | |
- 'OWNER=${_OWNER}' | |
- 'REPO_NAME=${REPO_NAME}' | |
images: ['${_IMAGE_NAME}:${BRANCH_NAME}'] | |
substitutions: | |
_ENVIRONMENT: '' | |
_IMAGE_NAME: 'asia.gcr.io/my_gcp_project/my_app' | |
_NAMESPACE: 'my_namespace' | |
_OWNER: 'my_email' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment