From 26c4f3e54534ed38f4134b56332259dd18c6882b Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Sun, 21 Jan 2024 17:26:09 +0530 Subject: [PATCH] [build]: Correct video and uploader image tag in chart Signed-off-by: Viet Nguyen Duc --- Makefile | 2 +- generate_release_notes.sh | 6 ++++-- update_tag_in_docs_and_files.sh | 10 ++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6aa26ae82..49e2986bd 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-6. FFMPEG_BASED_NAME := $(or $(FFMPEG_BASED_NAME),$(FFMPEG_BASED_NAME),ndviet) FFMPEG_BASED_TAG := $(or $(FFMPEG_BASED_TAG),$(FFMPEG_BASED_TAG),6.1-ubuntu2204) RCLONE_BASED_TAG := $(or $(RCLONE_BASED_TAG),$(RCLONE_BASED_TAG),1.65) -RCLONE_TAG_VERSION := $(or $(RCLONE_TAG_VERSION),$(RCLONE_TAG_VERSION),rclone-$(RCLONE_BASED_TAG)) +RCLONE_TAG_VERSION := $(or $(RCLONE_TAG_VERSION),$(RCLONE_TAG_VERSION),rclone-1.65) all: hub \ distributor \ diff --git a/generate_release_notes.sh b/generate_release_notes.sh index caf8f315f..f3fe9b954 100755 --- a/generate_release_notes.sh +++ b/generate_release_notes.sh @@ -5,6 +5,8 @@ HEAD_BRANCH=$2 GRID_VERSION=$3 BUILD_DATE=$4 NAMESPACE=${NAME:-selenium} +FFMPEG_TAG_VERSION=$(grep FFMPEG_TAG_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) +RCLONE_TAG_VERSION=$(grep RCLONE_TAG_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) TAG_VERSION=${GRID_VERSION}-${BUILD_DATE} @@ -18,8 +20,8 @@ CHROMEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} c EDGEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}') FIREFOX_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}') GECKODRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}') -FFMPEG_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/video:ffmpeg-6.1-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1) -RCLONE_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/uploader:rclone-1.65-${BUILD_DATE} rclone version | head -n 1 | awk '{print $2}') +FFMPEG_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/video:${FFMPEG_TAG_VERSION}-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1) +RCLONE_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/uploader:${RCLONE_TAG_VERSION}-${BUILD_DATE} rclone version | head -n 1 | awk '{print $2}') echo "" >> release_notes.md diff --git a/update_tag_in_docs_and_files.sh b/update_tag_in_docs_and_files.sh index 11da34f95..745feb371 100755 --- a/update_tag_in_docs_and_files.sh +++ b/update_tag_in_docs_and_files.sh @@ -5,6 +5,8 @@ NEXT_TAG=$2 LATEST_DATE=$(echo ${LATEST_TAG} | sed 's/.*-//') NEXT_DATE=$(echo ${NEXT_TAG} | sed 's/.*-//') latest_chart_app_version=$(find . \( -type d -name .git -prune \) -o -type f -name 'Chart.yaml' -print0 | xargs -0 cat | grep ^appVersion | cut -d ':' -f 2 | tr -d '[:space:]') +FFMPEG_TAG_VERSION=$(grep FFMPEG_TAG_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) +RCLONE_TAG_VERSION=$(grep RCLONE_TAG_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) echo -e "\033[0;32m Updating tag displayed in docs and files...\033[0m" echo -e "\033[0;32m LATEST_TAG -> ${LATEST_TAG}\033[0m" @@ -13,6 +15,14 @@ echo -e "\033[0;32m NEXT_TAG -> ${NEXT_TAG}\033[0m" # If you want to test this locally and you are using macOS, do `brew install gnu-sed` and change `sed` for `gsed`. find . \( -type d -name .git -prune \) -o -type f ! -name 'CHANGELOG.md' -print0 | xargs -0 sed -i "s/${LATEST_TAG}/${NEXT_TAG}/g" +if [[ "$NEXT_TAG" == "latest" ]] || [[ "$NEXT_TAG" == "nightly" ]]; then + # If you want to test this locally and you are using macOS, do `brew install gnu-sed` and change `sed` for `gsed`. + FFMPEG_LATEST_TAG=${FFMPEG_TAG_VERSION}-${LATEST_DATE} + RCLONE_LATEST_TAG=${RCLONE_TAG_VERSION}-${LATEST_DATE} + find . \( -type d -name .git -prune \) -o -type f ! -name 'CHANGELOG.md' -print0 | xargs -0 sed -i "s/${FFMPEG_LATEST_TAG}/${NEXT_TAG}/g" + find . \( -type d -name .git -prune \) -o -type f ! -name 'CHANGELOG.md' -print0 | xargs -0 sed -i "s/${RCLONE_LATEST_TAG}/${NEXT_TAG}/g" +fi + echo -e "\033[0;32m Updating date used in some docs and files...\033[0m" echo -e "\033[0;32m LATEST_DATE -> ${LATEST_DATE}\033[0m" echo -e "\033[0;32m NEXT_DATE -> ${NEXT_DATE}\033[0m"