Skip to content

Instantly share code, notes, and snippets.

@limbuu
Last active July 13, 2020 16:16
Show Gist options
  • Save limbuu/4f5e61a3e5f62b01755fd62e9051873b to your computer and use it in GitHub Desktop.
Save limbuu/4f5e61a3e5f62b01755fd62e9051873b to your computer and use it in GitHub Desktop.
steps:
- name: gcr.io/kaniko-project/executor:latest
id: 'Build1'
args: ['--destination=$_IMAGE_NAME:$COMMIT_SHA','--destination=$_IMAGE_NAME:latest','--cache=true', '--dockerfile=$_IMAGE_DOCKERFILE_PATH']
timeout: 500s
- name: "gcr.io/cloud-builders/gke-deploy"
id: 'Deploy'
args:
- run
- --filename=$_K8S_YAML_PATH
- --image=$_IMAGE1_NAME:$COMMIT_SHA
- --location=$_K8S_LOCATION
- --cluster=$_K8S_CLUSTER
timeout: 500s
substitutions:
_IMAGE_NAME: gcr.io/demo-cloudbuild/built-with-kaniko-image
_IMAGE_DOCKERFILE_PATH: Dockerfile
_K8S_APP_NAME: flask-app
_K8S_NAMESPACE: default
_K8S_YAML_PATH: deployment.yaml
_K8S_LOCATION: K8S-CLUSTER-LOCATION
_K8S_CLUSTER: K8s-CLUSTER-NAME
options:
substitution_option: 'ALLOW_LOOSE'
timeout: 1000s
tags: [$COMMIT_SHA,$_K8S_APP_NAME]
logsBucket: 'gs://cloudbuild-logs'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment