Skip to content

Commit a18af23

Browse files
psk001yurishkuro
andauthored
[ci]: skipping debug builds when not making a release (#4496)
Adjusted the build scripts to skip building debug versions unless the GH actions runs for a release by including a SKIP_DEBUG variable in command. --------- Signed-off-by: pushpak <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]>
1 parent c79cee3 commit a18af23

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

.github/workflows/ci-all-in-one-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18
4545

4646
- name: Build, test, and publish all-in-one image
47-
run: bash scripts/build-all-in-one-image.sh
47+
run: bash scripts/build-all-in-one-image.sh pr-only
4848
env:
4949
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
5050
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}

scripts/build-all-in-one-image.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ BRANCH=${BRANCH:?'missing BRANCH env var'}
77
# be overrided by passing architecture value to the script:
88
# `GOARCH=<target arch> ./scripts/build-all-in-one-image.sh`.
99
GOARCH=${GOARCH:-$(go env GOARCH)}
10-
10+
mode=${1-main}
1111
expected_version="v16"
1212
version=$(node --version)
1313
major_version=${version%.*.*}
14+
1415
if [ "$major_version" = "$expected_version" ] ; then
1516
echo "Node version is as expected: $version"
1617
else
@@ -46,10 +47,13 @@ run_integration_test localhost:5000/$repo
4647
bash scripts/build-upload-a-docker-image.sh -b -c all-in-one -d cmd/all-in-one -p "${platforms}" -t release
4748

4849

49-
make build-all-in-one-debug GOOS=linux GOARCH=$GOARCH
50-
repo=${repo}-debug
51-
#build all-in-one-debug image locally for integration test
52-
bash scripts/build-upload-a-docker-image.sh -l -b -c all-in-one-debug -d cmd/all-in-one -t debug
53-
run_integration_test localhost:5000/$repo
54-
#build all-in-one-debug image and upload to dockerhub/quay.io
55-
bash scripts/build-upload-a-docker-image.sh -b -c all-in-one-debug -d cmd/all-in-one -t debug
50+
#do not run debug image build when it is pr-only
51+
if ["$mode" != "pr-only"]; then
52+
make build-all-in-one-debug GOOS=linux GOARCH=$GOARCH
53+
repo=${repo}-debug
54+
#build all-in-one-debug image locally for integration test
55+
bash scripts/build-upload-a-docker-image.sh -l -b -c all-in-one-debug -d cmd/all-in-one -t debug
56+
run_integration_test localhost:5000/$repo
57+
#build all-in-one-debug image and upload to dockerhub/quay.io
58+
bash scripts/build-upload-a-docker-image.sh -b -c all-in-one-debug -d cmd/all-in-one -t debug
59+
fi

scripts/build-upload-docker-images.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ fi
2323
for component in agent collector query ingester remote-storage
2424
do
2525
bash scripts/build-upload-a-docker-image.sh -b -c "jaeger-${component}" -d "cmd/${component}" -p "${platforms}" -t release
26-
bash scripts/build-upload-a-docker-image.sh -b -c "jaeger-${component}-debug" -d "cmd/${component}" -t debug
26+
if ["$mode" != "pr-only"]; then
27+
#do not run debug image build when it is pr-only
28+
bash scripts/build-upload-a-docker-image.sh -b -c "jaeger-${component}-debug" -d "cmd/${component}" -t debug
29+
fi
2730
done
2831

2932
bash scripts/build-upload-a-docker-image.sh -b -c jaeger-es-index-cleaner -d cmd/es-index-cleaner -p "${platforms}" -t release

0 commit comments

Comments
 (0)