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

Simplify release script #4425

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/content/installation/installation-with-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ toc: true
docs: "DOCS-604"
---

{{< note >}}
An NGINX Ingress Operator version compatible with the 3.2.0 NGINX Ingress Controller release is not available yet. We will update this document and remove this note once we publish a compatible Operator version.
{{< /note >}}

This document describes how to install the F5 NGINX Ingress Controller in your Kubernetes cluster using the NGINX Ingress Operator.

## Prerequisites
Expand Down
31 changes: 31 additions & 0 deletions hack/changelog-template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
%%TITLE%%

%%RELEASE_DATE%%

### <i class="fa-solid fa-bomb"></i> Breaking Changes

### <i class="fa-solid fa-rocket"></i> Features

### <i class="fa-solid fa-bug-slash"></i> Fixes

### <i class="fa-solid fa-box"></i> Helm Chart

### <i class="fa-solid fa-upload"></i> Dependencies

### <i class="fa-solid fa-download"></i> Upgrade

- For NGINX, use the %%IC_VERSION%% images from our
[DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/tags?page=1&ordering=last_updated&name=%%IC_VERSION%%),
[GitHub Container](https://github.com/nginxinc/kubernetes-ingress/pkgs/container/kubernetes-ingress),
[Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-ingress) or [Quay.io](https://quay.io/repository/nginx/nginx-ingress).
- For NGINX Plus, use the %%IC_VERSION%% images from the F5 Container registry,
the [AWS Marketplace](https://aws.amazon.com/marketplace/search/?CREATOR=741df81b-dfdc-4d36-b8da-945ea66b522c&FULFILLMENT_OPTION_TYPE=CONTAINER&filters=CREATOR%2CFULFILLMENT_OPTION_TYPE),
the [GCP Marketplace](https://console.cloud.google.com/marketplace/browse?filter=partner:F5,%20Inc.&filter=solution-type:k8s&filter=category:networking)
or build your own image using the %%IC_VERSION%% source code
- For Helm, use version %%HELM_CHART_VERSION%% of the chart.

### <i class="fa-solid fa-life-ring"></i> Supported Platforms

We will provide technical support for NGINX Ingress Controller on any Kubernetes platform that is currently supported by
its provider and that passes the Kubernetes conformance tests. This release was fully tested on the following Kubernetes
versions: x.xx-x.xx.
Comment on lines +27 to +31
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think adding this to every minor release adds much value. Should we just add a link to https://docs.nginx.com/nginx-ingress-controller/technical-specifications/#supported-kubernetes-versions at the top of the page? @brianehlert @ADubhlaoich @Jcahilltorre

15 changes: 0 additions & 15 deletions hack/minor-changelog-template.txt

This file was deleted.

4 changes: 0 additions & 4 deletions hack/operator-note.txt

This file was deleted.

28 changes: 0 additions & 28 deletions hack/prepare-major-release.sh

This file was deleted.

32 changes: 0 additions & 32 deletions hack/prepare-minor-release.sh

This file was deleted.

47 changes: 23 additions & 24 deletions hack/common-release-prep.sh → hack/prepare-release.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env bash

# Updates the files required for a new release. Run this script in the release branch. Use it from
# hack/prepare-major-release.sh or hack/prepare-minor-release.sh
# Updates the files required for a new release. Run this script in the release branch.
#
# Usage:
# hack/common-release-prep.sh prev_ic_version ic-version prev_helm_chart_version helm-chart-version
# hack/prepare-release.sh ic-version helm-chart-version
#
# Example:
# hack/prepare-major-release.sh 1.12.1 1.13.0 0.10.1 0.11.0
# hack/prepare-release.sh 3.3.0 1.0.0

DOCS_TO_UPDATE_FOLDER=docs/content

FILES_TO_UPDATE_IC_VERSION=(
Makefile
README.md
deployments/daemon-set/nginx-ingress.yaml
deployments/daemon-set/nginx-plus-ingress.yaml
Expand All @@ -29,15 +29,26 @@ FILE_TO_UPDATE_HELM_CHART_VERSION=(
charts/nginx-ingress/README.md
)

DOCS_TO_UPDATE_FOLDER=docs/content
if [ $# != 2 ]; then
echo "Invalid number of arguments" 1>&2
echo "Usage: $0 ic-version helm-chart-version" 1>&2
exit 1
fi

ic_version=$1
helm_chart_version=$2

current_ic_version=$(yq '.appVersion' <deployments/helm-chart/Chart.yaml)
current_helm_chart_version=$(yq '.version' <deployments/helm-chart/Chart.yaml)

prev_ic_version=$1
ic_version=$2
prev_helm_chart_version=$3
helm_chart_version=$4
sed -i "" "s/$current_ic_version/$ic_version/g" ${FILES_TO_UPDATE_IC_VERSION[*]}
sed -i "" "s/$current_helm_chart_version/$helm_chart_version/g" ${FILE_TO_UPDATE_HELM_CHART_VERSION[*]}
find $DOCS_TO_UPDATE_FOLDER -type f -name "*.md" ! -name releases.md ! -name CHANGELOG.md -exec sed -i "" "s/$current_ic_version/$ic_version/g" {} +

sed -i "" "s/$prev_ic_version/$ic_version/g" ${FILES_TO_UPDATE_IC_VERSION[*]}
sed -i "" "s/$prev_helm_chart_version/$helm_chart_version/g" ${FILE_TO_UPDATE_HELM_CHART_VERSION[*]}
# update CHANGELOGs
sed -i "" "8r hack/changelog-template.txt" $DOCS_TO_UPDATE_FOLDER/releases.md
sed -i "" "1r hack/repo-changelog-template.txt" CHANGELOG.md
sed -i "" -e "s/%%TITLE%%/## $ic_version/g" -e "s/%%IC_VERSION%%/$ic_version/g" -e "s/%%HELM_CHART_VERSION%%/$helm_chart_version/g" $DOCS_TO_UPDATE_FOLDER/releases.md CHANGELOG.md

# copy the helm chart README to the docs
{
Expand All @@ -54,15 +65,3 @@ line_number=$(grep -n -e "|" docs/content/installation/installation-with-helm.md
sed -i '' "${line_number}a\\
{{% /table %}}
" docs/content/installation/installation-with-helm.md

# update repo CHANGELOG
sed -i "" "1r hack/repo-changelog-template.txt" CHANGELOG.md
sed -i "" -e "s/%%TITLE%%/## $ic_version/g" -e "s/%%IC_VERSION%%/$ic_version/g" -e "s/%%HELM_CHART_VERSION%%/$helm_chart_version/g" CHANGELOG.md

# update docs
find $DOCS_TO_UPDATE_FOLDER -type f -name "*.md" -exec sed -i "" "s/v$prev_ic_version/v$ic_version/g" {} +
find $DOCS_TO_UPDATE_FOLDER/installation -type f -name "*.md" -exec sed -i "" "s/$prev_ic_version/$ic_version/g" {} +
find $DOCS_TO_UPDATE_FOLDER/app-protect-* -type f -name "*.md" -exec sed -i "" "s/$prev_ic_version/$ic_version/g" {} +

# update IC version in the technical-specification doc
sed -i "" "s/$prev_ic_version/$ic_version/g" $DOCS_TO_UPDATE_FOLDER/technical-specifications.md
Loading