From 1b66aa499c9dad2757b83a5cac7070b4845164b8 Mon Sep 17 00:00:00 2001 From: shubbham1215 Date: Mon, 6 Mar 2023 16:54:52 +0530 Subject: [PATCH 1/5] 4163 | Speed-up CI by using published UI artifacts Signed-off-by: shubbham1215 --- Makefile | 4 ++-- scripts/rebuild-ui.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 scripts/rebuild-ui.sh diff --git a/Makefile b/Makefile index 9b0184166be..a9f52130251 100644 --- a/Makefile +++ b/Makefile @@ -214,8 +214,8 @@ jaeger-ui/packages/jaeger-ui/build/index.html: .PHONY: rebuild-ui rebuild-ui: - cd jaeger-ui && yarn install --frozen-lockfile && cd packages/jaeger-ui && yarn build - + ./scripts/rebuild-ui.sh + .PHONY: build-all-in-one-linux build-all-in-one-linux: GOOS=linux $(MAKE) build-all-in-one diff --git a/scripts/rebuild-ui.sh b/scripts/rebuild-ui.sh new file mode 100644 index 00000000000..57d66364a1e --- /dev/null +++ b/scripts/rebuild-ui.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +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 -O "$release_url"; then + curl --location --output "$temp_file" "$release_url" + mkdir -p packages/jaeger-ui/build/ + tar -zxvf "$temp_file" packages/jaeger-ui/build/ + exit 0 + fi +fi + +# do a regular full build +yarn install --frozen-lockfile && cd packages/jaeger-ui && yarn build + + + + + From c866872deeae01bbf0b0772c5e5896d0e9b52ba3 Mon Sep 17 00:00:00 2001 From: shubbham1215 Date: Mon, 6 Mar 2023 17:08:54 +0530 Subject: [PATCH 2/5] 4163 | Speed-up CI by using published UI artifacts Signed-off-by: shubbham1215 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a9f52130251..a6f8dfddc41 100644 --- a/Makefile +++ b/Makefile @@ -214,7 +214,7 @@ jaeger-ui/packages/jaeger-ui/build/index.html: .PHONY: rebuild-ui rebuild-ui: - ./scripts/rebuild-ui.sh + chmod u+x scripts/rebuild-ui.sh && ./scripts/rebuild-ui.sh .PHONY: build-all-in-one-linux build-all-in-one-linux: From ef7439cf89a5d7a64c01dac9c50594173c389282 Mon Sep 17 00:00:00 2001 From: shubbham1215 Date: Tue, 7 Mar 2023 00:49:24 +0530 Subject: [PATCH 3/5] 4163 | Speed-up CI by using published UI artifacts Signed-off-by: shubbham1215 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a6f8dfddc41..7f8ac632e66 100644 --- a/Makefile +++ b/Makefile @@ -214,7 +214,7 @@ jaeger-ui/packages/jaeger-ui/build/index.html: .PHONY: rebuild-ui rebuild-ui: - chmod u+x scripts/rebuild-ui.sh && ./scripts/rebuild-ui.sh + bash ./scripts/rebuild-ui.sh .PHONY: build-all-in-one-linux build-all-in-one-linux: From 2503333b3ccd77b7b983ec960953bfd65676b599 Mon Sep 17 00:00:00 2001 From: shubbham1215 Date: Tue, 7 Mar 2023 03:14:07 +0530 Subject: [PATCH 4/5] 4163 | Speed-up CI by using published UI artifacts Signed-off-by: shubbham1215 --- scripts/rebuild-ui.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/rebuild-ui.sh b/scripts/rebuild-ui.sh index 57d66364a1e..ecc827d8f90 100644 --- a/scripts/rebuild-ui.sh +++ b/scripts/rebuild-ui.sh @@ -9,13 +9,10 @@ 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 -O "$release_url"; then - curl --location --output "$temp_file" "$release_url" - mkdir -p packages/jaeger-ui/build/ - tar -zxvf "$temp_file" packages/jaeger-ui/build/ - exit 0 - fi + curl --location --output "$temp_file" "$release_url" + mkdir -p packages/jaeger-ui/build/ + tar -zxvf "$temp_file" packages/jaeger-ui/build/ + exit 0 fi # do a regular full build From af13a21789c115a22b64193307e9eebeef902f61 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Mon, 6 Mar 2023 22:41:47 -0500 Subject: [PATCH 5/5] Check for curl exit status Signed-off-by: Yuri Shkuro --- scripts/rebuild-ui.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/rebuild-ui.sh b/scripts/rebuild-ui.sh index ecc827d8f90..7134f47067a 100644 --- a/scripts/rebuild-ui.sh +++ b/scripts/rebuild-ui.sh @@ -9,10 +9,11 @@ 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" - curl --location --output "$temp_file" "$release_url" - mkdir -p packages/jaeger-ui/build/ - tar -zxvf "$temp_file" packages/jaeger-ui/build/ - exit 0 + 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 + fi fi # do a regular full build