Skip to content

Commit 211084c

Browse files
committed
update make rule docs
Signed-off-by: Jordan Dubrick <[email protected]>
1 parent 8419707 commit 211084c

File tree

3 files changed

+28
-35
lines changed

3 files changed

+28
-35
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ gosec:
290290
gosec -no-fail -fmt=sarif -out=gosec.sarif -exclude-dir pkg/test -exclude-dir tests ./...
291291

292292
### Release
293-
# RUN: make release new-version=x.x.x
293+
# RUN: make release NEW_VERSION=x.x.x
294294
.PHONY:
295295
release:
296-
sh make-release.sh ${new-version}
296+
sh make-release.sh ${NEW_VERSION}

README.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ Releases are available on [GitHub](https://github.com/devfile/registry-operator/
2323

2424
For more updates on releases, please join our [communication channels](https://devfile.io/docs/2.2.2/community#getting-involved).
2525

26-
## Preparing Releases
27-
A script has been created to make the release process more efficient. This script takes care of all changes to version numbers in all necessary files. Additionally this script opens the initial PR to devfile/registry-operator. The release engineer will be responsible for running this script with the instructions below.
28-
29-
1. Navigate to main branch of your forked registry-operator repository.
30-
2. Run `make release new-version=x.x.x` where x.x.x is the version you are trying to cut.
31-
3. Edit the PR opened by the script on devfile/registry-operator to include a proper description.
32-
3326
## Issue Tracking
3427

3528
Issue tracking repo: https://github.com/devfile/api with label area/registry
@@ -104,6 +97,7 @@ The repository contains a Makefile; building and deploying can be configured via
10497
| `TARGET_OS` | Target operating system for operator manager build, **only for `make manager`** | `linux` |
10598
| `PLATFORMS` | Target architecture(s) for `make docker-buildx` | All supported: `linux/arm64,linux/amd64,linux/s390x,linux/ppc64le` |
10699
| `KUSTOMIZE_INSTALL_SCRIPT` | URL of kustomize installation script, see [kustomize installation instructions](https://kubectl.docs.kubernetes.io/installation/kustomize/binaries/) | `https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh` |
100+
| `NEW_VERSION` | Release version being cut | |
107101

108102
Some of the rules supported by the makefile:
109103

@@ -131,6 +125,7 @@ Some of the rules supported by the makefile:
131125
| fmt_license | Ensure license header is set on all files |
132126
| vet | Check suspicious constructs into code |
133127
| gosec | Check for security problems in non-test source files |
128+
| release | Starts the process for cutting a new release |
134129

135130
To see all rules supported by the makefile, run `make help`
136131

make-release.sh

+24-26
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@
1818
set -eu
1919

2020
usage ()
21-
{ echo "Usage: ./make-release.sh <schema-version>"
21+
{ echo "Usage: make release NEW_VERSION=<x.x.x>"
2222
exit
2323
}
2424

2525
if [[ $# -lt 1 ]]; then usage; fi
26+
2627
SCHEMA_VERSION=$1
2728
FIRST_DIGIT="${SCHEMA_VERSION%%.*}"
2829
RELEASE_BRANCH="release-v${FIRST_DIGIT}"
2930
DEVFILE_REPO="[email protected]:devfile/registry-operator.git"
30-
## This will be uncommented for actual devfile repo
31-
#RELEASE_UPSTREAM_NAME="devfile-upstream-release"
32-
# This goes to my origin for testing
33-
RELEASE_UPSTREAM_NAME="origin"
31+
RELEASE_UPSTREAM_NAME="devfile-upstream-release"
3432

3533
if ! command -v hub > /dev/null; then
3634
echo "[ERROR] The hub CLI needs to be installed. See https://github.com/github/hub/releases"
@@ -75,34 +73,34 @@ checkoutToReleaseBranch() {
7573
resetChanges $SCHEMA_VERSION
7674
else
7775
echo "[INFO] $SCHEMA_VERSION does not exist. Will create a new one from main."
78-
resetChanges release-automation #change release-automation to main after testing
79-
git push origin release-automation:$SCHEMA_VERSION
76+
resetChanges main
77+
git push origin main:$SCHEMA_VERSION
8078
fi
8179
git checkout -B $SCHEMA_VERSION
8280
}
8381

8482

8583
updateVersionNumbers() {
86-
SHORT_UNAME=$(uname -s)
87-
88-
## Updating version.md based off of operating system
89-
if [ "$(uname)" == "Darwin" ]; then
90-
sed -i '' "s/^.*$/$SCHEMA_VERSION/" VERSION
91-
elif [ "${SHORT_UNAME:0:5}" == "Linux" ]; then
92-
sed -i "s/^.*$/$SCHEMA_VERSION/" VERSION
93-
fi
94-
95-
## Remaining version number updates to yaml files
96-
yq eval ".metadata.annotations.containerImage = \"quay.io/devfile/registry-operator:v$SCHEMA_VERSION\"" --inplace ./config/manifests/bases/registry-operator.clusterserviceversion.yaml
97-
yq eval ".metadata.name = \"registry-operator.v$SCHEMA_VERSION\"" --inplace ./config/manifests/bases/registry-operator.clusterserviceversion.yaml
98-
yq eval ".spec.version = \"$SCHEMA_VERSION\"" --inplace ./config/manifests/bases/registry-operator.clusterserviceversion.yaml
84+
SHORT_UNAME=$(uname -s)
85+
86+
## Updating version.md based off of operating system
87+
if [ "$(uname)" == "Darwin" ]; then
88+
sed -i '' "s/^.*$/$SCHEMA_VERSION/" VERSION
89+
elif [ "${SHORT_UNAME:0:5}" == "Linux" ]; then
90+
sed -i "s/^.*$/$SCHEMA_VERSION/" VERSION
91+
fi
92+
93+
## Remaining version number updates to yaml files
94+
yq eval ".metadata.annotations.containerImage = \"quay.io/devfile/registry-operator:v$SCHEMA_VERSION\"" --inplace ./config/manifests/bases/registry-operator.clusterserviceversion.yaml
95+
yq eval ".metadata.name = \"registry-operator.v$SCHEMA_VERSION\"" --inplace ./config/manifests/bases/registry-operator.clusterserviceversion.yaml
96+
yq eval ".spec.version = \"$SCHEMA_VERSION\"" --inplace ./config/manifests/bases/registry-operator.clusterserviceversion.yaml
9997
}
10098

10199
# Export env variables that are used in bundle scripts
102100
exportEnvironmentVariables() {
103-
CHANNEL=$(yq eval '.annotations."operators.operatorframework.io.bundle.channels.v1"' ./bundle/metadata/annotations.yaml)
104-
export IMG=quay.io/devfile/registry-operator:v$SCHEMA_VERSION
105-
export CHANNELS=$CHANNEL
101+
CHANNEL=$(yq eval '.annotations."operators.operatorframework.io.bundle.channels.v1"' ./bundle/metadata/annotations.yaml)
102+
export IMG=quay.io/devfile/registry-operator:v$SCHEMA_VERSION
103+
export CHANNELS=$CHANNEL
106104
}
107105

108106
# Commits version changes to your forked repository
@@ -117,7 +115,7 @@ commitChanges() {
117115
# with the name release-vX
118116
## This func will be used when we have a new major release and there is no branch in the upstream repo
119117
createNewReleaseBranch(){
120-
git checkout -b "${RELEASE_BRANCH}" release-automation #change to main after testing
118+
git checkout -b "${RELEASE_BRANCH}" main
121119
git push "${RELEASE_UPSTREAM_NAME}" "${RELEASE_BRANCH}"
122120
}
123121

@@ -134,11 +132,11 @@ verifyReleaseBranch() {
134132

135133
createPullRequest(){
136134
echo "[INFO] Creating a PR"
137-
hub pull-request --base jdubrick:${RELEASE_BRANCH} --head ${SCHEMA_VERSION} -m "$1" #jdubrick changes to devfile
135+
hub pull-request --base devfile:${RELEASE_BRANCH} --head ${SCHEMA_VERSION} -m "$1"
138136
}
139137

140138
main(){
141-
#setUpstream -- LEAVE COMMENTED AS THIS WILL SET MY ORIGIN TO DEVFILE
139+
setUpstream
142140
checkoutToReleaseBranch
143141
updateVersionNumbers
144142
exportEnvironmentVariables

0 commit comments

Comments
 (0)