-
Notifications
You must be signed in to change notification settings - Fork 313
Update release process to create a separate tag for registry-scanner #1022
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
Changes from 3 commits
41ee130
671ea1f
dc037ea
8a370b1
308b598
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 99.9.9 | ||
| 99.9.9 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 0.111.0 |
| 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. |
| 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 [email protected]: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! | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
| 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. |
| 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 | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this script takes 2 args, so the above comments need updating to reflect that. Also no PR is involved. |
||
| 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 | ||
ishitasequeira marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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}" | ||
ishitasequeira marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### 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}" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can create an annotated tag to include additional information about the tag? |
||
| git push "${REMOTE}" tag "${NEW_TAG}" | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we just name this file as |
||
Uh oh!
There was an error while loading. Please reload this page.