Skip to content

Commit 4a3aa80

Browse files
Update release process to create a separate tag for registry-scanner (#1022)
Signed-off-by: Ishita Sequeira <[email protected]>
1 parent 3726987 commit 4a3aa80

File tree

8 files changed

+167
-2
lines changed

8 files changed

+167
-2
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
99.9.9
1+
99.9.9

docs/contributing/releasing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Argo Image Updater is released in a 2 step automated fashion using GitHub actions. The release process takes about 20 minutes, sometimes a little less, depending on the performance of GitHub Actions runners.
44

5-
Releases can only be done by people that have write/commit access on the Argo Image Updater GitHub repository.
5+
Releases can only be done by people that have write/commit access on the Argo Image Updater GitHub repository.
66

77
## Introduction
88

hack/create-release-pr.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@ fi
4040

4141
echo $NEW_VERSION > VERSION
4242
IMAGE_TAG="v${NEW_VERSION}"
43+
# Update manifests
4344
make manifests
4445

46+
# Create PR for the release
4547
git checkout -b "feat/new-version-${NEW_VERSION}"
48+
49+
# Commit and push the changes
4650
git commit -m "Release ${NEW_VERSION}" VERSION manifests/
4751
git push --set-upstream ${REMOTE} "feat/new-version-${NEW_VERSION}"
4852
gh label --repo ${REMOTE_URL} create --force release

registry-scanner/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.111.0
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Developing
2+
3+
## Requirements
4+
5+
Getting started to develop Registry Scanner shouldn't be too hard. All that
6+
is required is a simple build toolchain, consisting of:
7+
8+
* Golang
9+
* GNU make
10+
* Docker (for building images, optional)
11+
* Kustomize (for building K8s manifests, optional)
12+
13+
## Makefile targets
14+
15+
Most steps in the development process are scripted in the `Makefile`, the most
16+
important targets are:
17+
18+
* `all` - this is the default target, and will run `golangci-lint` to ensure code is linted correctly and run all the unit tests.
19+
20+
* `lint` - this will run `golangci-lint` and ensure code is linted correctly.
21+
22+
* `test` - this will run all the unit tests
23+
24+
25+
## Sending Pull Requests
26+
27+
To send a pull request, simply fork the
28+
[GitHub repository](https://github.com/argoproj-labs/argocd-image-updater)
29+
to your GitHub account, create a new branch, commit & push your changes and then
30+
send the PR over for review. Changes should be
31+
[signed off](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--s)
32+
and committed with `-s` or `--signoff` options to meet
33+
[Developer Certificate of Origin](https://probot.github.io/apps/dco/) requirement.
34+
35+
When developing new features or fixing bugs, please make sure that your code is
36+
accompanied by appropriate unit tests. If you are fixing a bug, please also
37+
include a unit test for that specific bug.
38+
39+
Also, please make sure that your code is correctly linted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Releasing
2+
3+
Registry Scanner is released in a 1 step automated fashion. The release process takes about 5 minutes.
4+
5+
Releases can only be done by people that have write/commit access on the Argo Image Updater GitHub repository.
6+
7+
## Introduction
8+
9+
First install on your workstation the following:
10+
11+
1. GoLang
12+
1. The `git` executable
13+
1. The [GitHub CLI](https://cli.github.com/)
14+
1. The `semver` cli with `go install github.com/davidrjonas/semver-cli@latest`
15+
16+
Then create a release branch and cd to the submodule:
17+
18+
```bash
19+
git clone [email protected]:argoproj-labs/argocd-image-updater.git
20+
git checkout -b registry-scanner/release-0.13
21+
git push origin registry-scanner/release-0.13
22+
```
23+
24+
The release name is just an example. You should use the next number from the [previous release](https://github.com/argoproj-labs/argocd-image-updater/releases). Make sure that the branch is named as `registry-scanner/release-X.XX` though.
25+
26+
!!!Note:
27+
`TARGET_VERSION` is the version we want to release for registry-scanner module.
28+
29+
Also note that `origin` is just an example. It should be the name of your remote that holds the upstream branch of Argo Image updater repository.
30+
31+
Finally run
32+
33+
```bash
34+
cd registry-scanner
35+
./hack/create-release-pr.sh ${TARGET_VERSION} ${REMOTE}
36+
```
37+
38+
e.g.:
39+
```bash
40+
cd registry-scanner
41+
./hack/create-release-pr.sh 0.1.0 origin
42+
```
43+
44+
You are finished!
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Contributing to Registry Scanner
2+
3+
Contributing to Registry Scanner is easy! You can contribute in a number of
4+
ways, e.g.
5+
6+
* raise bug reports in the issue tracker,
7+
* send your ideas for enhancing Registry Scanner,
8+
* participate with your knowledge in existing issues,
9+
* vote for existing feature requests,
10+
* send Pull Requests for the docs, for the code, for the build toolchain, etc
11+
12+
Everyone is welcome to contribute!
13+
14+
If you just want to show some appreciation, make sure to star our GitHub repo.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
### This script creates a new release Tag for Registry Scanner
4+
# - install gh cli and semver-cli (go install github.com/davidrjonas/semver-cli@latest)
5+
# - create and push "registry-scanner/release-X.Y" branch
6+
# - checkout this branch locally
7+
# - run this script from repo registry-scanner module: ./hack/create-release.sh [TARGET_VERSION] [REMOTE]
8+
# - merge the PR
9+
10+
TARGET_VERSION="$1"
11+
set -eu
12+
set -o pipefail
13+
14+
if test "${TARGET_VERSION}" = ""; then
15+
echo "USAGE: $0 <version> <remote>" >&2
16+
exit 1
17+
fi
18+
19+
CURRENT_BRANCH="$(git branch --show-current)"
20+
SUBMODULE_NAME="registry-scanner"
21+
22+
if [[ ! "${CURRENT_BRANCH}" == registry-scanner/release-* ]]; then
23+
echo "!! Please checkout branch 'registry-scanner/release-X.Y' (currently in branch: '${CURRENT_BRANCH}')" >&2
24+
exit 1
25+
fi
26+
27+
RELEASE_BRANCH="${CURRENT_BRANCH}"
28+
29+
REMOTE=${2:-origin}
30+
REMOTE_URL=$(git remote get-url "${REMOTE}")
31+
32+
if [[ ! $(git ls-remote --exit-code ${REMOTE_URL} ${RELEASE_BRANCH}) ]]; then
33+
echo "!! Please make sure '${RELEASE_BRANCH}' exists in remote '${REMOTE}'" >&2
34+
exit 1
35+
fi
36+
37+
NEW_TAG="${SUBMODULE_NAME}/v${TARGET_VERSION}"
38+
39+
### look for latest on-branch tag to check if it matches the NEW_TAG
40+
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match "${SUBMODULE_NAME}/*" 2>/dev/null || true)
41+
42+
if [[ "${PREVIOUS_TAG}" == "${NEW_TAG}" ]]; then
43+
echo "!! Tag ${NEW_TAG} already exists" >&2
44+
exit 1
45+
fi
46+
47+
echo "Creating tag ${NEW_TAG}"
48+
echo "${TARGET_VERSION}" > VERSION
49+
50+
# Create tag for registry-scanner
51+
git tag "${NEW_TAG}"
52+
git push "${REMOTE}" tag "${NEW_TAG}"
53+

0 commit comments

Comments
 (0)