2019-04-05 22:12:27 +00:00
|
|
|
# Releasing
|
2018-09-05 05:31:21 +00:00
|
|
|
|
2020-06-09 19:05:52 +00:00
|
|
|
## Automated release procedure
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
Starting from `release-1.6` branch, ArgoCD can be released in an automated fashion
|
2020-06-09 19:05:52 +00:00
|
|
|
using GitHub actions. The release process takes about 20 minutes, sometimes a
|
2020-09-17 02:09:55 +00:00
|
|
|
little less, depending on the performance of GitHub Actions runners.
|
2020-06-09 19:05:52 +00:00
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
The target release branch must already exist in the GitHub repository. If you for
|
2020-06-09 19:05:52 +00:00
|
|
|
example want to create a release `v1.7.0`, the corresponding release branch
|
2020-09-17 02:09:55 +00:00
|
|
|
`release-1.7` needs to exist, otherwise, the release cannot be built. Also,
|
2020-06-09 19:05:52 +00:00
|
|
|
the trigger tag should always be created in the release branch, checked out
|
|
|
|
|
in your local repository clone.
|
|
|
|
|
|
|
|
|
|
Before triggering the release automation, the `CHANGELOG.md` should be updated
|
2020-09-17 02:09:55 +00:00
|
|
|
with the latest information, and this change should be committed and pushed to
|
|
|
|
|
the GitHub repository to the release branch. Afterward, the automation can be
|
2020-06-09 19:05:52 +00:00
|
|
|
triggered.
|
|
|
|
|
|
|
|
|
|
**Manual steps before release creation:**
|
|
|
|
|
|
|
|
|
|
* Update `CHANGELOG.md` with changes for this release
|
|
|
|
|
* Commit & push changes to `CHANGELOG.md`
|
|
|
|
|
* Prepare release notes (save to some file, or copy from Changelog)
|
|
|
|
|
|
|
|
|
|
**The automation will perform the following steps:**
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
* Update `VERSION` file in the release branch
|
|
|
|
|
* Update manifests with image tags of the new version in the release branch
|
2020-06-09 19:05:52 +00:00
|
|
|
* Build the Docker image and push to Docker Hub
|
2020-09-17 02:09:55 +00:00
|
|
|
* Create a release tag in the GitHub repository
|
|
|
|
|
* Create a GitHub release and attach the required assets to it (CLI binaries, ...)
|
2020-06-09 19:05:52 +00:00
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
Finally, it will the remove trigger tag from the repository again.
|
2020-06-09 19:05:52 +00:00
|
|
|
|
|
|
|
|
Automation supports both, GA and pre-releases. The automation is triggered by
|
|
|
|
|
pushing a tag to the repository. The tag must be in one of the following formats
|
|
|
|
|
to trigger the GH workflow:
|
|
|
|
|
|
|
|
|
|
* GA: `release-v<MAJOR>.<MINOR>.<PATCH>`
|
|
|
|
|
* Pre-release: `release-v<MAJOR>.<MINOR>.<PATCH>-rc<RC#>`
|
|
|
|
|
|
|
|
|
|
The tag must be an annotated tag, and it must contain the release notes in the
|
|
|
|
|
commit message. Please note that Markdown uses `#` character for formatting, but
|
2020-09-17 02:09:55 +00:00
|
|
|
Git uses it as comment char. To solve this, temporarily switch Git's comment char
|
2020-06-09 19:05:52 +00:00
|
|
|
to something else, the `;` character is recommended.
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
For example, consider you have configured the Git remote for the repository to
|
2020-06-09 19:05:52 +00:00
|
|
|
`github.com/argoproj/argo-cd` to be named `upstream` and are in your locally
|
|
|
|
|
checked out repo:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
git config core.commentChar ';'
|
|
|
|
|
git tag -a -F /path/to/release-notes.txt release-v1.6.0-rc2
|
|
|
|
|
git push upstream release-v1.6.0-rc2
|
|
|
|
|
git tag -d release-v1.6.0-rc2
|
|
|
|
|
git config core.commentChar '#'
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
For convenience, there is a shell script in the tree that ensures all the
|
|
|
|
|
pre-requisites are met and that the trigger is well-formed before pushing
|
|
|
|
|
it to the GitHub repo.
|
|
|
|
|
|
|
|
|
|
In summary, the modifications it does are:
|
|
|
|
|
|
|
|
|
|
* Create annotated trigger tag in your local repository
|
2020-09-17 02:09:55 +00:00
|
|
|
* Push the tag to the GitHub repository to trigger the workflow
|
2020-06-09 19:05:52 +00:00
|
|
|
* Remove trigger tag from your local repository
|
|
|
|
|
|
2021-01-08 07:05:38 +00:00
|
|
|
The script can be found at `hack/trigger-release.sh` and is used as follows:
|
2020-06-09 19:05:52 +00:00
|
|
|
|
|
|
|
|
```shell
|
2021-01-08 07:05:38 +00:00
|
|
|
./hack/trigger-release.sh <version> <remote name> [<release notes path>]
|
2020-06-09 19:05:52 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `<version>` identifier needs to be specified **without** the `release-`
|
|
|
|
|
prefix, so just specify it as `v1.6.0-rc2` for example. The `<remote name>`
|
|
|
|
|
specifies the name of the remote used to push to the GitHub repository.
|
|
|
|
|
|
|
|
|
|
If you omit the `<release notes path>`, an editor will pop-up asking you to
|
2020-09-17 02:09:55 +00:00
|
|
|
enter the tag's annotation so you can paste the release notes, save, and exit.
|
2020-06-09 19:05:52 +00:00
|
|
|
It will also take care of temporarily configuring the `core.commentChar` and
|
|
|
|
|
setting it back to its original state.
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
:warning:
|
2020-06-09 19:05:52 +00:00
|
|
|
It is strongly recommended to use this script to trigger the workflow
|
|
|
|
|
instead of manually pushing a tag to the repository.
|
|
|
|
|
|
|
|
|
|
Once the trigger tag is pushed to the repo, the GitHub workflow will start
|
2020-09-17 02:09:55 +00:00
|
|
|
execution. You can follow its progress under the `Actions` tab, the name of the
|
2020-06-09 19:05:52 +00:00
|
|
|
action is `Create release`. Don't get confused by the name of the running
|
2020-09-17 02:09:55 +00:00
|
|
|
workflow, it will be the commit message of the latest commit to the `master`
|
2020-06-09 19:05:52 +00:00
|
|
|
branch, this is a limitation of GH actions.
|
|
|
|
|
|
2020-09-03 21:03:48 +00:00
|
|
|
The workflow performs necessary checks so that the release can be successfully
|
2020-09-17 02:09:55 +00:00
|
|
|
built before the build actually starts. It will error when one of the
|
|
|
|
|
prerequisites is not met, or if the release cannot be built (i.e. already
|
2020-06-09 19:05:52 +00:00
|
|
|
exists, release notes invalid, etc etc). You can see a summary of what has
|
2020-09-17 02:09:55 +00:00
|
|
|
failed in the job's overview page and more detailed errors in the output
|
2020-06-09 19:05:52 +00:00
|
|
|
of the step that has failed.
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
:warning:
|
2020-06-09 19:05:52 +00:00
|
|
|
You cannot perform more than one release on the same release branch at the
|
|
|
|
|
same time. For example, both `v1.6.0` and `v1.6.1` would operate on the
|
|
|
|
|
`release-1.6` branch. If you submit `v1.6.1` while `v1.6.0` is still
|
|
|
|
|
executing, the release automation will not execute. You have to either
|
|
|
|
|
cancel `v1.6.0` before submitting `v1.6.1` or wait until it has finished.
|
|
|
|
|
You can execute releases on different release branches simultaneously, for
|
2020-09-17 02:09:55 +00:00
|
|
|
example, `v1.6.0` and `v1.7.0-rc1`, without problems.
|
2020-06-09 19:05:52 +00:00
|
|
|
|
|
|
|
|
### Verifying automated release
|
|
|
|
|
|
|
|
|
|
After the automatic release creation has finished, you should perform manual
|
|
|
|
|
checks to see if the release came out correctly:
|
|
|
|
|
|
|
|
|
|
* Check status & output of the GitHub action
|
|
|
|
|
* Check [https://github.com/argoproj/argo-cd/releases](https://github.com/argoproj/argo-cd/releases)
|
2020-09-17 02:09:55 +00:00
|
|
|
to see if the release has been correctly created and if all required assets
|
2020-06-09 19:05:52 +00:00
|
|
|
are attached.
|
|
|
|
|
* Check whether the image has been published on DockerHub correctly
|
|
|
|
|
|
|
|
|
|
### If something went wrong
|
|
|
|
|
|
|
|
|
|
If something went wrong, damage should be limited. Depending on the steps that
|
|
|
|
|
have been performed, you will need to manually clean up.
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
* Delete the release tag (e.g. `v1.6.0-rc2`) created in the GitHub repository. This
|
|
|
|
|
will immediately set the release (if created) to `draft` status, invisible to the
|
2020-06-09 19:05:52 +00:00
|
|
|
general public.
|
2020-09-17 02:09:55 +00:00
|
|
|
* Delete the draft release (if created) from the `Releases` page on GitHub
|
2020-06-09 19:05:52 +00:00
|
|
|
* If Docker image has been pushed to DockerHub, delete it
|
2020-09-17 02:09:55 +00:00
|
|
|
* If commits have been performed to the release branch, revert them. Paths that could have been committed to are:
|
2020-06-09 19:05:52 +00:00
|
|
|
* `VERSION`
|
|
|
|
|
* `manifests/*`
|
|
|
|
|
|
|
|
|
|
### Post-process manual steps
|
|
|
|
|
|
|
|
|
|
For now, the only manual steps left are to
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
* update stable tag in the GitHub repository to point to new the release (if appropriate)
|
|
|
|
|
* update the `VERSION` file on `master` if this is a new major release
|
2020-06-09 19:05:52 +00:00
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
These may be automated as well in the future.
|
2020-06-09 19:05:52 +00:00
|
|
|
|
|
|
|
|
## Manual releasing
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
The automatic release process does not interfere with the manual release process, since
|
2020-06-09 19:05:52 +00:00
|
|
|
the trigger tag does not match a normal release tag. If you prefer to perform,
|
|
|
|
|
manual release or if automatic release is for some reason broken, these are the
|
|
|
|
|
steps:
|
|
|
|
|
|
2019-05-29 21:53:00 +00:00
|
|
|
Make sure you are logged into Docker Hub:
|
2019-04-25 21:53:25 +00:00
|
|
|
|
2019-05-29 21:53:00 +00:00
|
|
|
```bash
|
|
|
|
|
docker login
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Export the upstream repository and branch name, e.g.:
|
2019-04-25 21:53:25 +00:00
|
|
|
|
|
|
|
|
```bash
|
2019-05-29 21:53:00 +00:00
|
|
|
REPO=upstream ;# or origin
|
2019-12-10 23:05:55 +00:00
|
|
|
BRANCH=release-1.3
|
2019-04-25 21:53:25 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Set the `VERSION` environment variable:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# release candidate
|
2019-12-10 23:05:55 +00:00
|
|
|
VERSION=v1.3.0-rc1
|
2019-04-25 21:53:25 +00:00
|
|
|
# GA release
|
2019-12-10 23:05:55 +00:00
|
|
|
VERSION=v1.3.1
|
2019-04-25 21:53:25 +00:00
|
|
|
```
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
Update `VERSION` and manifests with the new version:
|
2019-04-25 21:53:25 +00:00
|
|
|
|
2018-09-05 05:31:21 +00:00
|
|
|
```bash
|
2019-06-17 17:45:32 +00:00
|
|
|
git checkout $BRANCH
|
2019-05-29 21:53:00 +00:00
|
|
|
echo ${VERSION:1} > VERSION
|
2019-12-10 23:05:55 +00:00
|
|
|
make dev-tools-image
|
2019-04-25 21:53:25 +00:00
|
|
|
make manifests IMAGE_TAG=$VERSION
|
|
|
|
|
git commit -am "Update manifests to $VERSION"
|
2019-12-10 23:05:55 +00:00
|
|
|
git tag $VERSION
|
2018-09-05 05:31:21 +00:00
|
|
|
```
|
|
|
|
|
|
2019-12-10 23:05:55 +00:00
|
|
|
Build, and push release to Docker Hub
|
2019-04-25 21:53:25 +00:00
|
|
|
|
|
|
|
|
```bash
|
2019-06-17 17:45:32 +00:00
|
|
|
git clean -fd
|
2019-04-25 21:53:25 +00:00
|
|
|
make release IMAGE_NAMESPACE=argoproj IMAGE_TAG=$VERSION DOCKER_PUSH=true
|
2019-12-10 23:05:55 +00:00
|
|
|
git push $REPO $BRANCH
|
2019-05-29 21:53:00 +00:00
|
|
|
git push $REPO $VERSION
|
2019-04-25 21:53:25 +00:00
|
|
|
```
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
Update [GitHub releases](https://github.com/argoproj/argo-cd/releases) with:
|
2019-12-10 23:05:55 +00:00
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
* Getting started (copy from the previous release)
|
2019-12-10 23:05:55 +00:00
|
|
|
* Changelog
|
|
|
|
|
* Binaries (e.g. `dist/argocd-darwin-amd64`).
|
|
|
|
|
|
2020-06-09 19:05:52 +00:00
|
|
|
## Update brew formulae (manual)
|
|
|
|
|
|
2020-09-17 02:09:55 +00:00
|
|
|
If GA, update the Brew formula:
|
2019-04-25 21:53:25 +00:00
|
|
|
|
2018-09-05 05:31:21 +00:00
|
|
|
```bash
|
2020-09-03 21:44:55 +00:00
|
|
|
brew bump-formula-pr argocd --version ${VERSION:1}
|
2018-09-05 05:31:21 +00:00
|
|
|
```
|
2018-09-24 17:14:31 +00:00
|
|
|
|
2020-06-09 19:05:52 +00:00
|
|
|
## Update stable tag (manual)
|
|
|
|
|
|
|
|
|
|
If GA, update `stable` tag:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
git tag stable --force && git push $REPO stable --force
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Verify release
|
2019-04-25 21:53:25 +00:00
|
|
|
|
2019-05-29 21:53:00 +00:00
|
|
|
Locally:
|
2019-04-25 21:53:25 +00:00
|
|
|
|
2019-05-29 21:53:00 +00:00
|
|
|
```bash
|
|
|
|
|
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/$VERSION/manifests/install.yaml
|
2019-01-24 23:39:10 +00:00
|
|
|
```
|
2019-05-29 21:53:00 +00:00
|
|
|
|
|
|
|
|
Follow the [Getting Started Guide](../getting_started/).
|
|
|
|
|
|
|
|
|
|
If GA:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
brew upgrade argocd
|
|
|
|
|
/usr/local/bin/argocd version
|
2019-01-24 23:39:10 +00:00
|
|
|
```
|
2019-04-25 21:53:25 +00:00
|
|
|
|
2019-05-29 21:53:00 +00:00
|
|
|
Sync Argo CD in [https://cd.apps.argoproj.io/applications/argo-cd](https://cd.apps.argoproj.io/applications/argo-cd).
|
|
|
|
|
|
|
|
|
|
Deploy the [site](site.md).
|