Skip to content

Commit 8cf4d8b

Browse files
authored
Create release scripts for internal Jenkins release (#723)
1 parent 54492b1 commit 8cf4d8b

File tree

14 files changed

+500
-186
lines changed

14 files changed

+500
-186
lines changed

Makefile

Lines changed: 76 additions & 180 deletions
Large diffs are not rendered by default.

config/manifests/bases/coherence-operator.clusterserviceversion.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ spec:
8181
url: https://oracle.github.io/coherence-operator/docs/latest
8282
- name: Oracle Coherence
8383
url: https://coherence.community
84+
maintainers:
85+
- email: jonathan.knight@oracle.com
86+
name: Jonathan Knight
8487
maturity: mature
8588
minKubeVersion: 1.26.0
8689
provider:

hack/buildah/push-images.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Licensed under the Universal Permissive License v 1.0 as shown at
55
# http://oss.oracle.com/licenses/upl.
66
#
7-
set -x -e
7+
set -x -e -v
88

99
buildah version
1010

@@ -19,27 +19,22 @@ then
1919
buildah pull "docker-daemon:${OPERATOR_IMAGE_ARM}"
2020
fi
2121

22-
DESCR='The Oracle Coherence Kubernetes Operator allows full lifecycle management of Oracle Coherence workloads in Kubernetes.'
23-
2422
buildah rmi "${OPERATOR_IMAGE}" || true
2523
buildah manifest rm "${OPERATOR_IMAGE}" || true
2624
buildah manifest create \
2725
--annotation org.opencontainers.image.source=https://github.com/oracle/coherence-operator \
28-
--annotation org.opencontainers.image.description="${DESCR}" \
2926
--annotation org.opencontainers.image.licenses="UPL-1.0" \
3027
--annotation org.opencontainers.image.version="${VERSION}" \
3128
--annotation org.opencontainers.image.revision="${REVISION}" \
3229
"${OPERATOR_IMAGE}"
3330
buildah manifest add --arch amd64 --os linux \
3431
--annotation org.opencontainers.image.source=https://github.com/oracle/coherence-operator \
35-
--annotation org.opencontainers.image.description="${DESCR}" \
3632
--annotation org.opencontainers.image.licenses="UPL-1.0" \
3733
--annotation org.opencontainers.image.version="${VERSION}" \
3834
--annotation org.opencontainers.image.revision="${REVISION}" \
3935
"${OPERATOR_IMAGE}" "${OPERATOR_IMAGE_AMD}"
4036
buildah manifest add --arch arm64 --os linux \
4137
--annotation org.opencontainers.image.source=https://github.com/oracle/coherence-operator \
42-
--annotation org.opencontainers.image.description="${DESCR}" \
4338
--annotation "org.opencontainers.image.licenses"="UPL-1.0" \
4439
--annotation org.opencontainers.image.version="${VERSION}" \
4540
--annotation org.opencontainers.image.revision="${REVISION}" \

hack/buildah/run-buildah.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ else
8080
then
8181
$DOCKER_CMD volume create "${BUILDAH_VOLUME}"
8282
fi
83+
8384
if [ "${MY_DOCKER_HOST}" == "" ]
8485
then
8586
DOCKER_HOST="${MY_DOCKER_HOST}"

hack/bundle.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Copyright (c) 2020, 2025, Oracle and/or its affiliates.
3+
# Licensed under the Universal Permissive License v 1.0 as shown at
4+
# http://oss.oracle.com/licenses/upl.
5+
#
6+
7+
set -o errexit
8+
9+
ROOT_DIR=$(pwd)
10+
BUILD_OUTPUT=${ROOT_DIR}/build/_output
11+
BUILD_BUNDLE="${BUILD_OUTPUT}/bundle"
12+
VERSION=$(cat "${BUILD_OUTPUT}/version.txt")
13+
14+
echo "ROOT_DIR="${ROOT_DIR}""
15+
echo "GITHUB_REPO=${GITHUB_REPO}"
16+
echo "VERSION=${VERSION}"
17+
18+
BUNDLE_DIR="${BUILD_BUNDLE}/coherence-operator"
19+
mkdir -p "${BUNDLE_DIR}/${VERSION}/manifests" || true
20+
mkdir -p "${BUNDLE_DIR}/${VERSION}/metadata" || true
21+
mkdir -p "${BUNDLE_DIR}/${VERSION}/tests/scorecard" || true
22+
23+
for FILE in ${ROOT_DIR}/bundle/manifests/*; do
24+
NAME=$(basename ${FILE})
25+
echo "---" > "${BUNDLE_DIR}/${VERSION}/manifests/${NAME}"
26+
cat "${FILE}" >> "${BUNDLE_DIR}/${VERSION}/manifests/${NAME}"
27+
done
28+
29+
for FILE in ${ROOT_DIR}/bundle/metadata/*; do
30+
NAME=$(basename ${FILE})
31+
echo "---" > "${BUNDLE_DIR}/${VERSION}/metadata/${NAME}"
32+
cat "${FILE}" >> "${BUNDLE_DIR}/${VERSION}/metadata/${NAME}"
33+
done
34+
35+
for FILE in ${ROOT_DIR}/bundle/tests/scorecard/*; do
36+
NAME=$(basename ${FILE})
37+
echo "---" > "${BUNDLE_DIR}/${VERSION}/tests/scorecard/${NAME}"
38+
cat "${FILE}" >> "${BUNDLE_DIR}/${VERSION}/tests/scorecard/${NAME}"
39+
done

hack/github/get-gh.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2020, 2025, Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at
5+
# http://oss.oracle.com/licenses/upl.
6+
#
7+
set -o errexit
8+
9+
10+
ROOT_DIR=$(pwd)
11+
TOOLS_BIN=${ROOT_DIR}/build/tools/bin
12+
13+
UNAME_S=$(uname -s)
14+
UNAME_M=$(uname -m)
15+
16+
GH_CLI_VERSION=2.69.0
17+
18+
if [ "Darwin" = "${UNAME_S}" ]; then
19+
if [ "x86_64" = "${UNAME_M}" ]; then
20+
echo "Downloading GitHub CLI ${VERSION} ${UNAME_S} ${UNAME_M}"
21+
curl -Ls https://github.com/cli/cli/releases/download/v${GH_CLI_VERSION}/gh_${GH_CLI_VERSION}_macos_amd64.zip -o gh.zip
22+
unzip gh.zip
23+
mv gh_${GH_CLI_VERSION}_macOS_amd64/bin/gh ${TOOLS_BIN}/
24+
rm -rf gh_${GH_CLI_VERSION}_macOS_amd64
25+
rm gh.zip
26+
else
27+
echo "Downloading GitHub CLI ${VERSION} ${UNAME_S} ${UNAME_M}"
28+
curl -Ls https://github.com/cli/cli/releases/download/v${GH_CLI_VERSION}/gh_${GH_CLI_VERSION}_macos_arm64.zip -o gh.zip
29+
unzip gh.zip
30+
mv gh_${GH_CLI_VERSION}_macOS_arm64/bin/gh ${TOOLS_BIN}/
31+
rm -rf gh_${GH_CLI_VERSION}_macOS_arm64
32+
rm gh.zip
33+
fi
34+
else
35+
if [ "x86_64" = "${UNAME_M}" ]; then
36+
echo "Downloading GitHub CLI ${VERSION} ${UNAME_S} ${UNAME_M}"
37+
curl -Ls https://github.com/cli/cli/releases/download/v${GH_CLI_VERSION}/gh_${GH_CLI_VERSION}_linux_amd64.tar.gz -o gh.tar.gz
38+
tar -xvf gh.tar.gz
39+
mv gh_${GH_CLI_VERSION}_linux_amd64/bin/gh ${TOOLS_BIN}/
40+
rm -rf gh_${GH_CLI_VERSION}_linux_amd64
41+
else
42+
echo "Downloading GitHub CLI ${VERSION} ${UNAME_S} ${UNAME_M}"
43+
curl -Ls https://github.com/cli/cli/releases/download/v${GH_CLI_VERSION}/gh_${GH_CLI_VERSION}_linux_arm64.tar.gz -o gh.tar.gz
44+
tar -xvf gh.tar.gz
45+
mv gh_${GH_CLI_VERSION}_linux_arm64/bin/gh ${TOOLS_BIN}/
46+
rm -rf gh_${GH_CLI_VERSION}_linux_arm64
47+
rm gh.tar.gz
48+
fi
49+
fi
50+
51+
chmod +x ${TOOLS_BIN}/gh

hack/github/gh-release.sh

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2020, 2025, Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at
5+
# http://oss.oracle.com/licenses/upl.
6+
#
7+
8+
set -o -v errexit
9+
10+
GITHUB_REPO=$(git config --get remote.origin.url)
11+
BUILD_OUTPUT=build/_output
12+
RELEASE_ASSETS_DIR=${BUILD_OUTPUT}/github-release-assets
13+
14+
VERSION=$(cat ${BUILD_OUTPUT}/version.txt)
15+
16+
UNAME_S=$(uname -s)
17+
18+
echo ${GITHUB_REPO}
19+
echo ${VERSION}
20+
echo ${UNAME_S}
21+
22+
gh repo set-default ${GITHUB_REPO}
23+
24+
# create a temporary location for the release assets as we need to rename some
25+
rm -rf ${RELEASE_ASSETS_DIR}
26+
mkdir -p ${RELEASE_ASSETS_DIR}
27+
cp ${BUILD_OUTPUT}/coherence-operator-manifests.tar.gz ${RELEASE_ASSETS_DIR}
28+
cp ${BUILD_OUTPUT}/coherence-operator.yaml ${RELEASE_ASSETS_DIR}
29+
cp ${BUILD_OUTPUT}/coherence-operator-restricted.yaml ${RELEASE_ASSETS_DIR}
30+
cp ${BUILD_OUTPUT}/manifests/crd/coherence.oracle.com_coherence.yaml ${RELEASE_ASSETS_DIR}
31+
cp ${BUILD_OUTPUT}/manifests/crd-small/coherence.oracle.com_coherence.yaml ${RELEASE_ASSETS_DIR}/coherence.oracle.com_coherence_small.yaml
32+
cp ${BUILD_OUTPUT}/manifests/crd/coherencejob.oracle.com_coherence.yaml ${RELEASE_ASSETS_DIR}
33+
cp ${BUILD_OUTPUT}/manifests/crd-small/coherencejob.oracle.com_coherence.yaml ${RELEASE_ASSETS_DIR}/coherencejob.oracle.com_coherence_small.yaml
34+
cp ${BUILD_OUTPUT}/dashboards/${VERSION}/coherence-dashboards.tar.gz ${RELEASE_ASSETS_DIR}
35+
cp ${BUILD_OUTPUT}/coherence-operator-bundle.tar.gz ${RELEASE_ASSETS_DIR}
36+
cp ${BUILD_OUTPUT}/docs.zip ${RELEASE_ASSETS_DIR}
37+
38+
K8S_VERSIONS=$(yq '.jobs.build.strategy.matrix.matrixName[]' .github/workflows/k8s-matrix.yaml | tr '\n' ' ')
39+
OS_VERSIONS=$(cat ${BUILD_OUTPUT}/openshift-version.txt)
40+
cp hack/github/release-template.md ${RELEASE_ASSETS_DIR}/release-template.md
41+
if [ "Darwin" = "${UNAME_S}" ]; then
42+
sed -i '' -e "s^VERSION_PLACEHOLDER^${VERSION}^g" ${RELEASE_ASSETS_DIR}/release-template.md
43+
sed -i '' -e "s^K8S_VERSIONS_PLACEHOLDER^${K8S_VERSIONS}^g" ${RELEASE_ASSETS_DIR}/release-template.md
44+
sed -i '' -e "s^OPENSHIFT_VERSIONS_PLACEHOLDER^${OS_VERSIONS}^g" ${RELEASE_ASSETS_DIR}/release-template.md
45+
else
46+
sed -i -e "s^VERSION_PLACEHOLDER^${VERSION}^g" ${RELEASE_ASSETS_DIR}/release-template.md
47+
sed -i -e "s^K8S_VERSIONS_PLACEHOLDER^${K8S_VERSIONS}^g" ${RELEASE_ASSETS_DIR}/release-template.md
48+
sed -i -e "s^OPENSHIFT_VERSIONS_PLACEHOLDER^${OS_VERSIONS}^g" ${RELEASE_ASSETS_DIR}/release-template.md
49+
fi
50+
51+
gh release delete v${VERSION} --yes || true
52+
gh release create v${VERSION} --draft \
53+
--verify-tag \
54+
--generate-notes \
55+
--target ${RELEASE_BRANCH} \
56+
--latest \
57+
--notes-file "${RELEASE_ASSETS_DIR}/release-template.md"
58+
59+
# Upload all the various assets to the release
60+
gh release upload v${VERSION} "${RELEASE_ASSETS_DIR}/coherence-operator-manifests.tar.gz#Coherence Operator all install manifest files (.tar.gz)"
61+
gh release upload v${VERSION} "${RELEASE_ASSETS_DIR}/coherence-operator.yaml#Coherence Operator single install manifest file (.yaml)"
62+
gh release upload v${VERSION} "${RELEASE_ASSETS_DIR}/coherence-operator-restricted.yaml#Coherence Operator single restricted install manifest file (.yaml)"
63+
gh release upload v${VERSION} "${RELEASE_ASSETS_DIR}/coherence.oracle.com_coherence.yaml#Coherence full CRD (.yaml)"
64+
gh release upload v${VERSION} "${RELEASE_ASSETS_DIR}/coherence.oracle.com_coherence_small.yaml#Coherence reduced size CRD (.yaml)"
65+
gh release upload v${VERSION} "${RELEASE_ASSETS_DIR}/coherencejob.oracle.com_coherence.yaml#CoherenceJob full CRD (.yaml)"
66+
gh release upload v${VERSION} "${RELEASE_ASSETS_DIR}/coherencejob.oracle.com_coherence_small.yaml#CoherenceJob reduced size CRD (.yaml)"
67+
gh release upload v${VERSION} "${RELEASE_ASSETS_DIR}/coherence-dashboards.tar.gz#Coherence Grafana Dashboards (.tar.gz)"
68+
gh release upload v${VERSION} "${RELEASE_ASSETS_DIR}/coherence-operator-bundle.tar.gz#Coherence Operator OLM bundle (.tar.gz)"
69+
gh release upload v${VERSION} "${RELEASE_ASSETS_DIR}/docs.zip#Coherence Operator documentation (.zip)"
70+

hack/github/github-pages.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2020, 2025, Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at
5+
# http://oss.oracle.com/licenses/upl.
6+
#
7+
8+
set -o -v errexit
9+
10+
ROOT_DIR=$(pwd)
11+
GITHUB_REPO=$(git config --get remote.origin.url)
12+
GITHUB_REPO=https://github.com/oracle/coherence-operator.git
13+
BUILD_OUTPUT=${ROOT_DIR}/build/_output
14+
BUILD_GH_PAGES="${ROOT_DIR}/gh-pages"
15+
VERSION=$(cat "${BUILD_OUTPUT}/version.txt")
16+
17+
@echo "ROOT_DIR="${ROOT_DIR}""
18+
@echo "GITHUB_REPO=${GITHUB_REPO}"
19+
@echo "VERSION=${VERSION}"
20+
21+
rm -rf ${BUILD_GH_PAGES}
22+
git clone -b gh-pages --single-branch ${GITHUB_REPO} "${ROOT_DIR}/gh-pages"
23+
cd ${BUILD_GH_PAGES}
24+
25+
mkdir -p ${BUILD_GH_PAGES}/dashboards || true
26+
rm -rf ${BUILD_GH_PAGES}/dashboards/${VERSION} || true
27+
cp -R ${BUILD_OUTPUT}/dashboards/${VERSION} ${BUILD_GH_PAGES}/dashboards/
28+
git add dashboards/${VERSION}/*
29+
rm -rf ${BUILD_GH_PAGES}/dashboards/latest || true
30+
cp -R ${BUILD_GH_PAGES}/dashboards/${VERSION} ${BUILD_GH_PAGES}/dashboards/latest
31+
git add -A dashboards/latest/*
32+
33+
mkdir ${BUILD_GH_PAGES}/docs/${VERSION} || true
34+
rm -rf ${BUILD_GH_PAGES}/docs/${VERSION}/ || true
35+
cp -R ${BUILD_OUTPUT}/docs ${BUILD_GH_PAGES}/docs/${VERSION}/
36+
rm -rf ${BUILD_GH_PAGES}/docs/latest
37+
cp -R ${BUILD_GH_PAGES}/docs/${VERSION} ${BUILD_GH_PAGES}/docs/latest
38+
git add -A docs/*
39+
40+
mkdir -p ${BUILD_GH_PAGES}/charts || true
41+
cp ${BUILD_OUTPUT}/helm-charts/coherence-operator-${VERSION}.tgz ${BUILD_GH_PAGES}/charts/
42+
helm repo index charts --url https://oracle.github.io/coherence-operator/charts
43+
git add charts/coherence-operator-${VERSION}.tgz
44+
git add charts/index.yaml
45+
46+
git clean -d -f
47+
48+
git status
49+
50+
git commit -m "Release Coherence Operator version: ${VERSION}"
51+
git log -1
52+
git push origin gh-pages
53+
54+
cd ${ROOT_DIR}

hack/github/release-template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Coherence Operator Release VERSION_PLACEHOLDER
2+
3+
- Supported Kubernetes versions: K8S_VERSIONS_PLACEHOLDER
4+
5+
- Supported OpenShift versions: OPENSHIFT_VERSIONS_PLACEHOLDER
6+

hack/openshift/get-oc.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# Copyright (c) 2020, 2025, Oracle and/or its affiliates.
3+
# Licensed under the Universal Permissive License v 1.0 as shown at
4+
# http://oss.oracle.com/licenses/upl.
5+
#
6+
set -o errexit
7+
8+
9+
ROOT_DIR=$(pwd)
10+
TOOLS_BIN=${ROOT_DIR}/build/tools/bin
11+
12+
UNAME_S=$(uname -s)
13+
UNAME_M=$(uname -m)
14+
15+
rm -rf oc-tmp
16+
mkdir oc-tmp
17+
18+
if [ "Darwin" = "${UNAME_S}" ]; then
19+
if [ "x86_64" = "${UNAME_M}" ]; then
20+
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
21+
curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-mac.tar.gz -o oc-tmp/openshift-client.tar.gz
22+
else
23+
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
24+
curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-mac-arm64.tar.gz -o oc-tmp/openshift-client.tar.gz
25+
fi
26+
else
27+
if [ "x86_64" = "${UNAME_M}" ]; then
28+
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
29+
curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz -o oc-tmp/openshift-client.tar.gz
30+
else
31+
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
32+
curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-linux.tar.gz -o oc-tmp/openshift-client.tar.gz
33+
fi
34+
fi
35+
36+
cd oc-tmp && tar -xvf openshift-client.tar.gz
37+
mv oc-tmp/oc ${TOOLS_BIN}/oc
38+
rm -rf oc-tmp
39+
40+
chmod +x ${TOOLS_BIN}/oc

0 commit comments

Comments
 (0)