Created
August 1, 2022 04:41
-
-
Save ajiteshk/6c0915eec428aa1dcea7a1ddda39415a 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: | |
- name: 'gcr.io/cloud-builders/git' | |
entrypoint: /bin/bash | |
args: | |
- -c | |
- | | |
git fetch --depth=2 origin main | |
echo hello | |
git log | |
git --no-pager diff --name-only HEAD^ HEAD | grep "/" | cut -d/ -f1 | sort | uniq > /workspace/diff.txt | |
- name: 'gcr.io/cloud-builders/gcloud' | |
entrypoint: /bin/bash | |
args: | |
- -c | |
- | | |
while read line | |
do | |
config="${line}/cloudbuild.yaml" | |
echo $config | |
if [[ ! -f "${config}" ]]; then | |
echo "no such file" | |
continue | |
fi | |
gcloud builds submit $line --config=${config} | |
done < /workspace/diff.txt | |
options: | |
logging: CLOUD_LOGGING_ONLY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment