-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate releasing registry-scanner from image-updater
Signed-off-by: Ishita Sequeira <ishiseq29@gmail.com>
- Loading branch information
1 parent
41ee130
commit 671ea1f
Showing
6 changed files
with
162 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.111.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Developing | ||
|
||
## Requirements | ||
|
||
Getting started to develop Registry Scanner shouldn't be too hard. All that | ||
is required is a simple build toolchain, consisting of: | ||
|
||
* Golang | ||
* GNU make | ||
* Docker (for building images, optional) | ||
* Kustomize (for building K8s manifests, optional) | ||
|
||
## Makefile targets | ||
|
||
Most steps in the development process are scripted in the `Makefile`, the most | ||
important targets are: | ||
|
||
* `all` - this is the default target, and will run `golangci-lint` to ensure code is linted correctly and run all the unit tests. | ||
|
||
* `lint` - this will run `golangci-lint` and ensure code is linted correctly. | ||
|
||
* `test` - this will run all the unit tests | ||
|
||
|
||
## Sending Pull Requests | ||
|
||
To send a pull request, simply fork the | ||
[GitHub repository](https://github.com/argoproj-labs/argocd-image-updater) | ||
to your GitHub account, create a new branch, commit & push your changes and then | ||
send the PR over for review. Changes should be | ||
[signed off](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--s) | ||
and committed with `-s` or `--signoff` options to meet | ||
[Developer Certificate of Origin](https://probot.github.io/apps/dco/) requirement. | ||
|
||
When developing new features or fixing bugs, please make sure that your code is | ||
accompanied by appropriate unit tests. If you are fixing a bug, please also | ||
include a unit test for that specific bug. | ||
|
||
Also, please make sure that your code is correctly linted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Releasing | ||
|
||
Registry Scanner is released in a 1 step automated fashion. The release process takes about 5 minutes. | ||
|
||
Releases can only be done by people that have write/commit access on the Argo Image Updater GitHub repository. | ||
|
||
## Introduction | ||
|
||
First install on your workstation the following: | ||
|
||
1. GoLang | ||
1. The `git` executable | ||
1. The [GitHub CLI](https://cli.github.com/) | ||
1. The `semver` cli with `go install github.com/davidrjonas/semver-cli@latest` | ||
|
||
Then create a release branch and cd to the submodule: | ||
|
||
```bash | ||
git clone git@github.com:argoproj-labs/argocd-image-updater.git | ||
git checkout -b registry-scanner/release-0.13 | ||
git push origin registry-scanner/release-0.13 | ||
``` | ||
|
||
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. | ||
|
||
!!!Note: | ||
`TARGET_VERSION` is the version we want to release for registry-scanner module. | ||
|
||
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. | ||
|
||
Finally run | ||
|
||
```bash | ||
cd registry-scanner | ||
./hack/create-release-pr.sh ${TARGET_VERSION} ${REMOTE} | ||
``` | ||
|
||
e.g.: | ||
```bash | ||
cd registry-scanner | ||
./hack/create-release-pr.sh 0.1.0 origin | ||
``` | ||
|
||
You are finished! | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Contributing to Registry Scanner | ||
|
||
Contributing to Registry Scanner is easy! You can contribute in a number of | ||
ways, e.g. | ||
|
||
* raise bug reports in the issue tracker, | ||
* send your ideas for enhancing Registry Scanner, | ||
* participate with your knowledge in existing issues, | ||
* vote for existing feature requests, | ||
* send Pull Requests for the docs, for the code, for the build toolchain, etc | ||
|
||
Everyone is welcome to contribute! | ||
|
||
If you just want to show some appreciation, make sure to star our GitHub repo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
### This script creates a new release PR | ||
# - install gh cli and semver-cli (go install github.com/davidrjonas/semver-cli@latest) | ||
# - create and push "release-X.Y" branch | ||
# - checkout this branch locally | ||
# - run this script from repo root: ./hack/create-release-pr.sh [REMOTE] | ||
# - merge the PR | ||
# It will trigger the release workflow that would create release draft on github | ||
|
||
TARGET_VERSION="$1" | ||
set -eu | ||
set -o pipefail | ||
|
||
if test "${TARGET_VERSION}" = ""; then | ||
echo "USAGE: $0 <version>" >&2 | ||
exit 1 | ||
fi | ||
|
||
CURRENT_BRANCH="$(git branch --show-current)" | ||
SUBMODULE_NAME="registry-scanner" | ||
|
||
if [[ ! "$CURRENT_BRANCH" == release-* ]]; then | ||
echo "!! Please checkout branch 'release-X.Y' (currently in branch: '${CURRENT_BRANCH}')" >&2 | ||
exit 1 | ||
fi | ||
|
||
RELEASE_BRANCH="${CURRENT_BRANCH}" | ||
|
||
REMOTE=${2:-origin} | ||
REMOTE_URL=$(git remote get-url "${REMOTE}") | ||
|
||
if [[ ! $(git ls-remote --exit-code ${REMOTE_URL} ${RELEASE_BRANCH}) ]]; then | ||
echo "!! Please make sure '${RELEASE_BRANCH}' exists in remote '${REMOTE}'" >&2 | ||
exit 1 | ||
fi | ||
|
||
NEW_TAG="registry-scanner/v${TARGET_VERSION}" | ||
|
||
### look for latest on-branch tag to check if it matches the NEW_TAG | ||
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match "${SUBMODULE_NAME}/*" 2>/dev/null || true) | ||
|
||
if [ "${PREVIOUS_TAG}" == "${NEW_TAG}" ]; then | ||
echo "!! Tag ${NEW_TAG} already exists" >&2 | ||
exit 1 | ||
fi | ||
|
||
echo "Creating tag ${NEW_TAG}" | ||
echo "${TARGET_VERSION}" > VERSION | ||
|
||
# Create tag for registry-scanner | ||
git tag "${NEW_TAG}" | ||
git push "${REMOTE}" tag "${NEW_TAG}" | ||
|