Skip to content

Commit da67082

Browse files
authored
Install git and clone the repository when revision is present (#4913)
I've added a command to install git and clone the clusterfuzz repository if the clusterfuzz revision is passed as a substituition. This is needed because GCB doesn't pass the content of the respository as a git project, then we're not able to change the version in the build time. The workaround for this is to clone the repository in build time and then checkout in the given revision. --------- Signed-off-by: Javan Lacerda <javanlacerda@google.com>
1 parent 65d1a05 commit da67082

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

deploy/cloudbuild.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,31 @@ steps:
3232
else
3333
echo "☑️ _CLUSTERFUZZ_CONFIG_REVISION is not set. Using the latest commit."
3434
fi
35-
- name: gcr.io/clusterfuzz-images/base:091c6c2-202409251610
35+
36+
- name: gcr.io/cloud-builders/git
3637
entrypoint: bash
3738
args:
3839
- -c
3940
- |
40-
# Conditionally run 'git checkout' if the revision is provided
41+
# Conditionally clone the upstream clusterfuzz and 'git checkout' if the revision is provided
4142
if [ -n "${_CLUSTERFUZZ_REVISION}" ]; then
4243
echo "✅ _CLUSTERFUZZ_REVISION is set. Checking out to commit: ${_CLUSTERFUZZ_REVISION}"
44+
git clone https://github.com/google/clusterfuzz.git
45+
cd clusterfuzz
4346
git checkout "${_CLUSTERFUZZ_REVISION}"
4447
else
4548
echo "☑️ _CLUSTERFUZZ_REVISION is not set. Using the latest commit."
4649
fi
50+
51+
- name: gcr.io/clusterfuzz-images/base:091c6c2-202409251610
52+
entrypoint: bash
53+
args:
54+
- -c
55+
- |
56+
# Conditionally run go into the cloned clusterfuzz
57+
if [ -n "${_CLUSTERFUZZ_REVISION}" ]; then
58+
cd clusterfuzz
59+
fi
4760
4861
# Install required deps for performing butler deploy
4962
bash ./local/install_deps.bash

0 commit comments

Comments
 (0)