Skip to content

Commit

Permalink
[ci]: skipping debug builds when not making a release (jaegertracing#…
Browse files Browse the repository at this point in the history
…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 <puspak9208@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
  • Loading branch information
psk001 and yurishkuro authored Jun 4, 2023
1 parent c79cee3 commit a18af23
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-all-in-one-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18

- name: Build, test, and publish all-in-one image
run: bash scripts/build-all-in-one-image.sh
run: bash scripts/build-all-in-one-image.sh pr-only
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
20 changes: 12 additions & 8 deletions scripts/build-all-in-one-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ BRANCH=${BRANCH:?'missing BRANCH env var'}
# be overrided by passing architecture value to the script:
# `GOARCH=<target arch> ./scripts/build-all-in-one-image.sh`.
GOARCH=${GOARCH:-$(go env GOARCH)}

mode=${1-main}
expected_version="v16"
version=$(node --version)
major_version=${version%.*.*}

if [ "$major_version" = "$expected_version" ] ; then
echo "Node version is as expected: $version"
else
Expand Down Expand Up @@ -46,10 +47,13 @@ run_integration_test localhost:5000/$repo
bash scripts/build-upload-a-docker-image.sh -b -c all-in-one -d cmd/all-in-one -p "${platforms}" -t release


make build-all-in-one-debug GOOS=linux GOARCH=$GOARCH
repo=${repo}-debug
#build all-in-one-debug image locally for integration test
bash scripts/build-upload-a-docker-image.sh -l -b -c all-in-one-debug -d cmd/all-in-one -t debug
run_integration_test localhost:5000/$repo
#build all-in-one-debug image and upload to dockerhub/quay.io
bash scripts/build-upload-a-docker-image.sh -b -c all-in-one-debug -d cmd/all-in-one -t debug
#do not run debug image build when it is pr-only
if ["$mode" != "pr-only"]; then
make build-all-in-one-debug GOOS=linux GOARCH=$GOARCH
repo=${repo}-debug
#build all-in-one-debug image locally for integration test
bash scripts/build-upload-a-docker-image.sh -l -b -c all-in-one-debug -d cmd/all-in-one -t debug
run_integration_test localhost:5000/$repo
#build all-in-one-debug image and upload to dockerhub/quay.io
bash scripts/build-upload-a-docker-image.sh -b -c all-in-one-debug -d cmd/all-in-one -t debug
fi
5 changes: 4 additions & 1 deletion scripts/build-upload-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ fi
for component in agent collector query ingester remote-storage
do
bash scripts/build-upload-a-docker-image.sh -b -c "jaeger-${component}" -d "cmd/${component}" -p "${platforms}" -t release
bash scripts/build-upload-a-docker-image.sh -b -c "jaeger-${component}-debug" -d "cmd/${component}" -t debug
if ["$mode" != "pr-only"]; then
#do not run debug image build when it is pr-only
bash scripts/build-upload-a-docker-image.sh -b -c "jaeger-${component}-debug" -d "cmd/${component}" -t debug
fi
done

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

0 comments on commit a18af23

Please sign in to comment.