Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
99.9.9
99.9.9
2 changes: 1 addition & 1 deletion docs/contributing/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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.

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

## Introduction

Expand Down
4 changes: 4 additions & 0 deletions hack/create-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ fi

echo $NEW_VERSION > VERSION
IMAGE_TAG="v${NEW_VERSION}"
# Update manifests
make manifests

# Create PR for the release
git checkout -b "feat/new-version-${NEW_VERSION}"

# Commit and push the changes
git commit -m "Release ${NEW_VERSION}" VERSION manifests/
git push --set-upstream ${REMOTE} "feat/new-version-${NEW_VERSION}"
gh label --repo ${REMOTE_URL} create --force release
Expand Down
1 change: 1 addition & 0 deletions registry-scanner/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.111.0
39 changes: 39 additions & 0 deletions registry-scanner/docs/contributing/development.md
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.
54 changes: 54 additions & 0 deletions registry-scanner/docs/contributing/releasing.md
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!










14 changes: 14 additions & 0 deletions registry-scanner/docs/contributing/start.md
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.
54 changes: 54 additions & 0 deletions registry-scanner/hack/create-release-pr.sh
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

Copy link
Collaborator

Choose a reason for hiding this comment

The 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the usage should warn about 2 args

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have kept the remote as an optional parameter defaulting to origin.

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}"
Copy link
Collaborator

Choose a reason for hiding this comment

The 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}"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just name this file as create-release.sh since it just creates a release tag, without any PR?

Loading