From 15de450a20ef0491cc365c39c48c34befd2f44b4 Mon Sep 17 00:00:00 2001 From: Andy Zhang Date: Sat, 12 Oct 2024 17:59:32 +0800 Subject: [PATCH 1/2] chore(release): create a docker image to facilitate the update-copyright step (cherry picked from commit 07b3c8368031b6047db54b5a1c1a950139d0cadf) --- scripts/Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/Dockerfile diff --git a/scripts/Dockerfile b/scripts/Dockerfile new file mode 100644 index 000000000000..154d43da0ee9 --- /dev/null +++ b/scripts/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:latest AS expat-build + +ARG expat_version=2.6.3 + +SHELL ["/bin/bash", "-c"] + +WORKDIR /workspace + +RUN apt update \ + && apt install -y curl + +RUN curl -L https://github.com/libexpat/libexpat/releases/download/R_${expat_version//./_}/expat-${expat_version}.tar.gz | tar -xz \ + && cd expat-${expat_version} \ + && apt install -y build-essential \ + && ./configure --prefix=/expat_lib \ + && make && make install + +FROM ubuntu:latest + +COPY --from=expat-build /expat_lib /expat_lib + +RUN apt update && apt install -y curl libssl-dev libyaml-dev lua5.4 luarocks + +WORKDIR /workspace +CMD ["/bin/bash", "-c", "OPENSSL_DIR=/usr EXPAT_DIR=/expat_lib scripts/update-copyright"] + +VOLUME /workspace From aa248290e5b07c581d63d8b4202378ec63a7a70d Mon Sep 17 00:00:00 2001 From: Andy Zhang Date: Sat, 12 Oct 2024 18:00:29 +0800 Subject: [PATCH 2/2] chore(release): execute the update-copyright script in the docker container with all necessary dependencies (cherry picked from commit ef43c3501175231fa3749c3d7a49b0d4e1ae8830) --- scripts/release-lib.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/release-lib.sh b/scripts/release-lib.sh index 20e474c7372e..4a88e90b1c8e 100644 --- a/scripts/release-lib.sh +++ b/scripts/release-lib.sh @@ -120,7 +120,9 @@ function commit_changelog() { function update_copyright() { version=$1 - if ! "$scripts_folder/update-copyright" + PDIR=$(dirname "$scripts_folder") + + if ! (docker build -t kong/update-copyright ${scripts_folder} && docker run -v ${PDIR}:/workspace --rm kong/update-copyright) then die "Could not update copyright file. Check logs for missing licenses, add hardcoded ones if needed" fi