Skip to content

Commit

Permalink
fix: add directory prune to int build config
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerthatdev committed Oct 7, 2023
1 parent 3e421d6 commit 742bb83
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@

timeout: 14400s
steps:
- id: prune unchanged directories
name: gcr.io/cloud-builders/git
entrypoint: bash
args:
- -c
- |
git fetch --unshallow
git diff origin/${_BASE_BRANCH}..origin/${_HEAD_BRANCH} --name-only > _changed_files
sed 's/\/.*/\//' _changed_files > _changed_folders
for d in */; do
if ! grep -q ^$d _changed_folders; then
rm -rf $d;
fi
done
- id: prepare
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && prepare_environment']
Expand Down

0 comments on commit 742bb83

Please sign in to comment.