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
#!/bin/bash | |
# optain personal access token from Github to use for https clone | |
#https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token | |
printf "https://GIT_USERNAME:GITHUB_PERSONAL_TOKEN@github.com/GIT_ORGANAIZATION/ENVIRONMENT_REPO_NAME.git" | gcloud secrets create ENV_REPO_AUTH_URL --data-file=- | |
# For more details about cloud build and it's configration, | |
# please refer to https://cloud.google.com/build/docs/concepts | |
# if you use Github or BitBucket, you need to connect GCP project with your account |
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
#Environment-Demo-cloudbuild.yaml | |
steps: | |
- name: 'gcr.io/cloud-builders/kubectl' | |
args: ['apply', '-k', './production/'] | |
env: | |
- 'CLOUDSDK_COMPUTE_ZONE=asia-southeast1-a' | |
- 'CLOUDSDK_CONTAINER_CLUSTER=gke-cicd' |
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
#Demo-app-cloudbuild.yaml | |
steps: | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['build', '-t', 'asia.gcr.io/PROJECT_ID/gke-demo-app:$SHORT_SHA', '.' ] | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['push', 'asia.gcr.io/PROJECT_ID/gke-demo-app:$SHORT_SHA'] | |
- name: 'omegaes/kubci' |