Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4163 | Speed-up CI by using published UI artifacts #4314

Merged
merged 9 commits into from
Mar 19, 2023
28 changes: 19 additions & 9 deletions scripts/rebuild-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,26 @@ set -euxf -o pipefail

cd jaeger-ui

tag=$(git describe --exact-match --tags)
if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
temp_file=$(mktemp)
trap "rm -f ${temp_file}" EXIT
release_url="https://github.com/jaegertracing/jaeger-ui/releases/download/${tag}/assets.tar.gz"
if curl --silent --fail --location --output "$temp_file" "$release_url"; then
mkdir -p packages/jaeger-ui/build/
tar -zxvf "$temp_file" packages/jaeger-ui/build/
exit 0
LAST_TAG=$(git describe --abbrev=0 --tags 2>/dev/null)
BRANCH_HASH=$(git rev-parse HEAD)
LAST_TAG_HASH=$(git rev-parse $LAST_TAG)

if [[ "$BRANCH_HASH" == "$LAST_TAG_HASH" ]]; then

if [[ "$LAST_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
temp_file=$(mktemp)
trap "rm -f ${temp_file}" EXIT
release_url="https://github.com/jaegertracing/jaeger-ui/releases/download/${LAST_TAG}/assets.tar.gz"
if curl --silent --fail --location --output "$temp_file" "$release_url"; then

mkdir -p packages/jaeger-ui/build/
rm -r -f packages/jaeger-ui/build/
tar -zxvf "$temp_file" packages/jaeger-ui/build/
exit 0

fi
fi

fi

# do a regular full build
Expand Down