Created
August 1, 2022 04:41
-
-
Save ajiteshk/af27d782579a89387daa4d4e2a3e51e3 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