8000 Split docs script cherry pick (#5090) · nginx/kubernetes-ingress@d025e88 · GitHub
[go: up one dir, main page]

Skip to content

Commit d025e88

Browse files
authored
Split docs script cherry pick (#5090)
* Split version update script (#4961) * Bump nginx from `156d75f` to `f2802c2` in /build (#5072) * Bump redhat/ubi8 from `23d8dfd` to `627867e` in /build (#5073) * Bump opentracing/nginx-opentracing from `2e0268d` to `2217e9f` in /build (#5074)
1 parent 0f45ece commit d025e88

File tree

5 files changed

+76
-23
lines changed

5 files changed

+76
-23
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
3+
set -o pipefail
4+
5+
ROOTDIR=$(git rev-parse --show-toplevel || echo ".")
6+
TMPDIR=/tmp
7+
DEBUG=${DEBUG:-"false"}
8+
9+
DOCS_TO_UPDATE_FOLDER=${ROOTDIR}/docs/content
10+
11+
usage() {
12+
echo "Usage: $0 <ic_version> <helm_chart_version> <k8s_versions> <release_date>"
13+
exit 1
14+
}
15+
16+
ic_version=$1
17+
helm_chart_version=$2
18+
k8s_versions=$3
19+
release_date=$4
20+
21+
if [ -z "${ic_version}" ]; then
22+
usage
23+
fi
24+
25+
if [ -z "${helm_chart_version}" ]; then
26+
usage
27+
fi
28+
29+
if [ -z "${k8s_versions}" ]; then
30+
usage
31+
fi
32+
33+
if [ -z "${release_date}" ]; then
34+
usage
35+
fi
36+
37+
# update releases docs
38+
file_path=${DOCS_TO_UPDATE_FOLDER}/releases.md
39+
if [ "${DEBUG}" != "false" ]; then
40+
echo "Processing ${file_path}"
41+
fi
42+
file_name=$(basename "${file_path}")
43+
mv "${file_path}" "${TMPDIR}/${file_name}"
44+
sed -e "8r ${ROOTDIR}/hack/changelog-template.txt" "${TMPDIR}/${file_name}" | sed \
45+
-e "s/%%TITLE%%/## $ic_version/g" \
46+
-e "s/%%IC_VERSION%%/$ic_version/g" \
47+
-e "s/%%HELM_CHART_VERSION%%/$helm_chart_version/g" \
48+
-e "s/%%K8S_VERSIONS%%/$k8s_versions.\n/g" \
49+
-e "s/%%RELEASE_DATE%%/$release_date/g" \
50+
> ${file_path}
51+
if [ $? -ne 0 ]; then
52+
echo "ERROR: failed processing ${file_path}"
53+
mv "${TMPDIR}/${file_name}" "${file_path}"
54+
exit 2
55+
fi

.github/scripts/release-version-update.sh

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,16 @@ if [ -z "${helm_chart_version}" ]; then
4949
fi
5050

5151
current_ic_version=$(yq '.appVersion' <"${HELM_CHART_PATH}/Chart.yaml")
52+
escaped_current_ic_version=$(printf '%s' "$current_ic_version" | sed -e 's/\./\\./g');
5253
current_helm_chart_version=$(yq '.version' <"${HELM_CHART_PATH}/Chart.yaml")
54+
escaped_current_helm_chart_version=$(printf '%s' "$current_helm_chart_version" | sed -e 's/\./\\./g');
5355

5456
echo "Updating versions: "
5557
echo "ic_version: ${current_ic_version} -> ${ic_version}"
5658
echo "helm_chart_version: ${current_helm_chart_version} -> ${helm_chart_version}"
5759

58-
regex_ic="s#$current_ic_version#$ic_version#g"
59-
regex_helm="s#$current_helm_chart_version#$helm_chart_version#g"
60+
regex_ic="s#$escaped_current_ic_version#$ic_version#g"
61+
regex_helm="s#$escaped_current_helm_chart_version#$helm_chart_version#g"
6062

6163
mv "${HELM_CHART_PATH}/values.schema.json" "${TMPDIR}/"
6264
jq --arg version "${ic_version}" \
@@ -115,17 +117,3 @@ for i in ${docs_files}; do
115117
exit 2
116118
fi
117119
done
118-
119-
# update releases docs
120-
file_path=${DOCS_TO_UPDATE_FOLDER}/releases.md
121-
if [ "${DEBUG}" != "false" ]; then
122-
echo "Processing ${file_path}"
123-
fi
124-
file_name=$(basename "${file_path}")
125-
mv "${file_path}" "${TMPDIR}/${file_name}"
126-
cat "${TMPDIR}/${file_name}" | sed -e "8r ${ROOTDIR}/hack/changelog-template.txt" | sed -e "s/%%TITLE%%/## $ic_version/g" -e "s/%%IC_VERSION%%/$ic_version/g" -e "s/%%HELM_CHART_VERSION%%/$helm_chart_version/g" > ${file_path}
127-
if [ $? -ne 0 ]; then
128-
echo "ERROR: failed processing ${file_path}"
129-
mv "${TMPDIR}/${file_name}" "${file_path}"
130-
exit 2
131-
fi

.github/workflows/release-pr.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ on:
1111
description: "Helm version to release"
1212
required: true
1313
default: "0.0.0"
14+
k8s_versions:
15+
description: "Kubernetes versions this release has been tested on"
16+
required: true
17+
default: "x.xx-x.xx"
18+
release_date:
19+
description: "Date for this release"
20+
required: true
21+
default: "%d %b %Y"
1422

1523
defaults:
1624
run:
@@ -39,7 +47,9 @@ jobs:
3947
token: ${{ secrets.NGINX_PAT }}
4048

4149
- name: Replace
42-
run: .github/scripts/release-version-update.sh ${{ github.event.inputs.version }} ${{ github.event.inputs.helm_version }}
50+
run: |
51+
.github/scripts/release-version-update.sh ${{ github.event.inputs.version }} ${{ github.event.inputs.helm_version }}
52+
.github/scripts/release-notes-update.sh ${{ github.event.inputs.version }} ${{ github.event.inputs.helm_version }} "${{ github.event.inputs.k8s_versions }}" "${{ github.event.inputs.release_date }}"
4353
4454
- name: Create Pull Request
4555
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2

build/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ ARG DEBIAN_FRONTEND=noninteractive
66

77

88
############################################# Base images containing libs for Opentracing and FIPS #############################################
9-
FROM opentracing/nginx-opentracing:nginx-1.25.3@sha256:2e0268d3cd31fe047c2fe566f29731865b0c99cc99b579c6584b23cd3c7830ef as opentracing-lib
10-
FROM opentracing/nginx-opentracing:nginx-1.25.3-alpine@sha256:08ccc2c8bb28f01cb17b7619f139830b3af7950826b819b267393aefa32f23ab as alpine-opentracing-lib
9+
FROM opentracing/nginx-opentracing:nginx-1.25.3@sha256:2217e9fa36a2130d395a40bb051965cf64c9d10087281e301e9c0b60ce2a1a57 as opentracing-lib
10+
FROM opentracing/nginx-opentracing:nginx-1.25.3-alpine@sha256:37c7de3a46ca05428450b1c64bfb2a4d2f9c1835860cef427928fcf11c178f0e as alpine-opentracing-lib
1111
FROM ghcr.io/nginxinc/alpine-fips:0.1.1-alpine3.18@sha256:6f124002650fae697152290a14a7caa7f21884e8d78d8236c63fec2d018d721d as alpine-fips
1212

1313

1414
############################################# Base image for Alpine #############################################
15-
FROM nginx:1.25.3-alpine@sha256:156d75f07c59b2fd59d3d1470631777943bb574135214f0a90c7bb82bde916da AS alpine
15+
FROM nginx:1.25.3-alpine@sha256:f2802c2a9d09c7aa3ace27445dfc5656ff24355da28e7b958074a0111e3fc076 AS alpine
1616

1717
RUN --mount=type=bind,from=alpine-opentracing-lib,target=/tmp/ot/ \
1818
apk add --no-cache libcap libstdc++ \
@@ -24,7 +24,7 @@ RUN --mount=type=bind,from=alpine-opentracing-lib,target=/tmp/ot/ \
2424

2525

2626
############################################# Base image for Debian #############################################
27-
FROM nginx:1.25.3@sha256:8b4c32060a41e8c07e4b33c2e2695510c729314d84b2b71a1c5d7002aaf0b5ad AS debian
27+
FROM nginx:1.25.3@sha256:84c52dfd55c467e12ef85cad6a252c0990564f03c4850799bf41dd738738691f AS debian
2828

2929
RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
3030
apt-get update \
@@ -208,7 +208,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
208208

209209

210210
############################################# Base image for UBI with NGINX Plus and App Protect WAF/DoS #############################################
211-
FROM redhat/ubi8@sha256:23d8dfd08024fdfa34b168c297d8c74a1dc58675b02b3418925932df123b755c as ubi-plus-nap
211+
FROM redhat/ubi8@sha256:627867e53ad6846afba2dfbf5cef1d54c868a9025633ef0afd546278d4654eac as ubi-plus-nap
212212
ARG NAP_MODULES
213213

214214
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \

hack/changelog-template.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ or build your own image using the %%IC_VERSION%% source code
2828

2929
We will provide technical support for NGINX Ingress Controller on any Kubernetes platform that is currently supported by
3030
its provider and that passes the Kubernetes conformance tests. This release was fully tested on the following Kubernetes
31-
versions: x.xx-x.xx.
31+
versions: %%K8S_VERSIONS%%

0 commit comments

Comments
 (0)
0