Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro committed Sep 14, 2024
1 parent 2fa9a94 commit 9291433
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 29 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/ci-docker-all-in-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,11 @@ jobs:
;;
esac
- name: Customize the build based on v1/v2 version
run: |
if [[ "${{ matrix.jaeger_version }}" == "v1" ]]; then
echo "HEALTHCHECK_V2=false" >> $GITHUB_ENV
echo "JAEGER_BINARY=all-in-one" >> $GITHUB_ENV
elif [[ "${{ matrix.jaeger_version }}" == "v2" ]]; then
echo "HEALTHCHECK_V2=true" >> $GITHUB_ENV
echo "JAEGER_BINARY=jaeger" >> $GITHUB_ENV
fi
- name: Build, test, and publish all-in-one image
run: |
bash scripts/build-all-in-one-image.sh \
${{ env.BUILD_FLAGS }} \
-b ${{ env.JAEGER_BINARY }}
"${{ matrix.jaeger_version }}"
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
HEALTHCHECK_V2: ${{ env.HEALTHCHECK_V2 }}
8 changes: 4 additions & 4 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ jobs:
run: |
BRANCH=$(make echo-v1) \
bash scripts/build-all-in-one-image.sh \
-b all-in-one \
${{ steps.params.outputs.docker_flags }}
${{ steps.params.outputs.docker_flags }} \
v1
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
Expand All @@ -153,8 +153,8 @@ jobs:
run: |
BRANCH=$(make echo-v2) \
bash scripts/build-all-in-one-image.sh \
-b jaeger \
${{ steps.params.outputs.docker_flags }}
${{ steps.params.outputs.docker_flags }} \
v2
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
Expand Down
44 changes: 32 additions & 12 deletions scripts/build-all-in-one-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,22 @@
set -euf -o pipefail

print_help() {
echo "Usage: $0 [-b binary] [-D] [-h] [-l] [-o] [-p platforms]"
echo "-b: Which binary to build: 'all-in-one' (default) or 'jaeger' (v2)"
echo "-D: Disable building of images with debugger"
echo "-h: Print help"
echo "-l: Enable local-only mode that only pushes images to local registry"
echo "-o: overwrite image in the target remote repository even if the semver tag already exists"
echo "-p: Comma-separated list of platforms to build for (default: all supported)"
echo "Usage: $0 [-b binary] [-D] [-h] [-l] [-o] [-p platforms] <jaeger_version>"
echo " -D: Disable building of images with debugger"
echo " -h: Print help"
echo " -l: Enable local-only mode that only pushes images to local registry"
echo " -o: overwrite image in the target remote repository even if the semver tag already exists"
echo " -p: Comma-separated list of platforms to build for (default: all supported)"
echo " jaeger_version: major version, v1 | v2"
exit 1
}

add_debugger='Y'
platforms="$(make echo-linux-platforms)"
FLAGS=()
BINARY='all-in-one'

while getopts "b:Dhlop:" opt; do
while getopts "Dhlop:" opt; do
case "${opt}" in
b)
BINARY=${OPTARG}
;;
D)
add_debugger='N'
;;
Expand All @@ -45,6 +41,30 @@ while getopts "b:Dhlop:" opt; do
esac
done

# remove flags, leave only positional args
shift $((OPTIND - 1))

if [[ $# -eq 0 ]]; then
echo "Jaeger major version is required as argument"
print_help
fi

case $1 in
v1)
JAEGER_MAJOR=v1
BINARY='all-in-one'
export HEALTHCHECK_V2=false
;;
v2)
JAEGER_MAJOR=v2
BINARY='jaeger'
export HEALTHCHECK_V2=true
;;
*)
echo "Jaeger major version is required as argument"
print_help
esac

set -x

# Set default GOARCH variable to the host GOARCH, the target architecture can
Expand Down
2 changes: 1 addition & 1 deletion scripts/compute-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -euf -o pipefail
SED=${SED:-sed}

usage() {
echo "Usage: $0 -v -s <jaeger_version>"
echo "Usage: $0 [-s] [-v] <jaeger_version>"
echo " -s split semver into 4 parts: semver major minor patch"
echo " -v verbose"
echo " jaeger_version: major version, v1 | v2"
Expand Down

0 comments on commit 9291433

Please sign in to comment.