Created
April 27, 2020 15:11
-
-
Save bharatmicrosystems/b107357560e2c4317756fac79814d42c 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
steps: | |
# Pull the existing image | |
- name: 'gcr.io/cloud-builders/docker' | |
entrypoint: 'bash' | |
args: | |
- '-c' | |
- | | |
docker pull gcr.io/$PROJECT_ID/tomcat:latest || exit 0 | |
# Build a docker image | |
- name: 'gcr.io/cloud-builders/docker' | |
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/tomcat', '--cache-from', 'gcr.io/$PROJECT_ID/tomcat', '.' ] | |
# Push the docker image to container registry | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ["push", "gcr.io/$PROJECT_ID/tomcat"] | |
# Deploy an image from Container Registry to Cloud Run | |
- name: 'gcr.io/cloud-builders/gcloud' | |
args: ['beta', 'run', 'deploy', 'tomcat', '--image', 'gcr.io/$PROJECT_ID/tomcat:latest', '--region', 'europe-west1', '--platform', 'managed', '--allow-unauthenticated'] | |
images: | |
- 'gcr.io/$PROJECT_ID/tomcat' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment