mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-22 02:28:46 +01:00
Compare commits
9 Commits
appsetdocs
...
v1.6.0-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5bcc1dbcc | ||
|
|
4d7e6945bd | ||
|
|
df65d017a2 | ||
|
|
283645e63e | ||
|
|
0e016a368d | ||
|
|
26d711a6db | ||
|
|
1f12aac601 | ||
|
|
b39e93a4d2 | ||
|
|
97aa28a687 |
289
.github/workflows/release.yaml
vendored
Normal file
289
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,289 @@
|
||||
name: Create ArgoCD release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'release-v*'
|
||||
- '!release-v1.5*'
|
||||
- '!release-v1.4*'
|
||||
- '!release-v1.3*'
|
||||
- '!release-v1.2*'
|
||||
- '!release-v1.1*'
|
||||
- '!release-v1.0*'
|
||||
- '!release-v0*'
|
||||
jobs:
|
||||
prepare-release:
|
||||
name: Perform automatic release on trigger ${{ github.ref }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
# The name of the tag as supplied by the GitHub event
|
||||
SOURCE_TAG: ${{ github.ref }}
|
||||
# The image namespace where Docker image will be published to
|
||||
IMAGE_NAMESPACE: argoproj
|
||||
# Whether to create & push image and release assets
|
||||
DRY_RUN: false
|
||||
# Whether a draft release should be created, instead of public one
|
||||
DRAFT_RELEASE: false
|
||||
# The name of the repository containing tap formulae
|
||||
TAP_REPOSITORY: argoproj/homebrew-tap
|
||||
# Whether to update homebrew with this release as well
|
||||
# Set RELEASE_HOMEBREW_TOKEN secret in repository for this to work - needs
|
||||
# access to public repositories (or homebrew-tap repo specifically)
|
||||
UPDATE_HOMEBREW: false
|
||||
# Name of the GitHub user for Git config
|
||||
GIT_USERNAME: argo-bot
|
||||
# E-Mail of the GitHub user for Git config
|
||||
GIT_EMAIL: argoproj@gmail.com
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Check if the published tag is well formed and setup vars
|
||||
run: |
|
||||
set -xue
|
||||
# Target version must match major.minor.patch and optional -rcX suffix
|
||||
# where X must be a number.
|
||||
TARGET_VERSION=${SOURCE_TAG#*release-v}
|
||||
if ! echo ${TARGET_VERSION} | egrep '^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)*$'; then
|
||||
echo "::error::Target version '${TARGET_VERSION}' is malformed, refusing to continue." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Target branch is the release branch we're going to operate on
|
||||
# Its name is 'release-<major>.<minor>'
|
||||
TARGET_BRANCH="release-${TARGET_VERSION%\.[0-9]*}"
|
||||
|
||||
# The release tag is the source tag, minus the release- prefix
|
||||
RELEASE_TAG="${SOURCE_TAG#*release-}"
|
||||
|
||||
# Whether this is a pre-release (indicated by -rc suffix)
|
||||
PRE_RELEASE=false
|
||||
if echo "${RELEASE_TAG}" | egrep -- '-rc[0-9]+$'; then
|
||||
PRE_RELEASE=true
|
||||
fi
|
||||
|
||||
# We must not have a release trigger within the same release branch,
|
||||
# because that means a release for this branch is already running.
|
||||
if git tag -l | grep "release-v${TARGET_VERSION%\.[0-9]*}" | grep -v "release-v${TARGET_VERSION}"; then
|
||||
echo "::error::Another release for branch ${TARGET_BRANCH} is currently in progress."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure that release do not yet exist
|
||||
if git rev-parse ${RELEASE_TAG}; then
|
||||
echo "::error::Release tag ${RELEASE_TAG} already exists in repository. Refusing to continue."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make the variables available in follow-up steps
|
||||
echo "::set-env name=TARGET_VERSION::${TARGET_VERSION}"
|
||||
echo "::set-env name=TARGET_BRANCH::${TARGET_BRANCH}"
|
||||
echo "::set-env name=RELEASE_TAG::${RELEASE_TAG}"
|
||||
echo "::set-env name=PRE_RELEASE::${PRE_RELEASE}"
|
||||
|
||||
- name: Check if our release tag has a correct annotation
|
||||
run: |
|
||||
set -ue
|
||||
# Fetch all tag information as well
|
||||
git fetch --prune --tags --force
|
||||
|
||||
echo "=========== BEGIN COMMIT MESSAGE ============="
|
||||
git show ${SOURCE_TAG}
|
||||
echo "============ END COMMIT MESSAGE =============="
|
||||
|
||||
# Quite dirty hack to get the release notes from the annotated tag
|
||||
# into a temporary file.
|
||||
RELEASE_NOTES=$(mktemp -p /tmp release-notes.XXXXXX)
|
||||
|
||||
prefix=true
|
||||
begin=false
|
||||
git show ${SOURCE_TAG} | while read line; do
|
||||
# Whatever is in commit history for the tag, we only want that
|
||||
# annotation from our tag. We discard everything else.
|
||||
if test "$begin" = "false"; then
|
||||
if echo $line | grep -q "tag ${SOURCE_TAG#refs/tags/}"; then begin="true"; fi
|
||||
continue
|
||||
fi
|
||||
if test "$prefix" = "true"; then
|
||||
if test -z "$line"; then prefix=false; fi
|
||||
else
|
||||
if echo $line | egrep -q '^commit [0-9a-f]+'; then
|
||||
break
|
||||
fi
|
||||
echo $line >> ${RELEASE_NOTES}
|
||||
fi
|
||||
done
|
||||
|
||||
# For debug purposes
|
||||
echo "============BEGIN RELEASE NOTES================="
|
||||
cat ${RELEASE_NOTES}
|
||||
echo "=============END RELEASE NOTES=================="
|
||||
|
||||
# Too short release notes are suspicious. We need at least 100 bytes.
|
||||
relNoteLen=$(stat -c '%s' $RELEASE_NOTES)
|
||||
if test $relNoteLen -lt 100; then
|
||||
echo "::error::No release notes provided in tag annotation (or tag is not annotated)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for magic string '## Quick Start' in head of release notes
|
||||
if ! head -2 ${RELEASE_NOTES} | grep -iq '## Quick Start'; then
|
||||
echo "::error::Release notes seem invalid, quick start section not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We store path to temporary release notes file for later reading, we
|
||||
# need it when creating release.
|
||||
echo "::set-env name=RELEASE_NOTES::$RELEASE_NOTES"
|
||||
|
||||
- name: Setup Golang
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.14.2'
|
||||
|
||||
- name: Setup Git author information
|
||||
run: |
|
||||
set -ue
|
||||
git config --global user.email "${GIT_EMAIL}"
|
||||
git config --global user.name "${GIT_USERNAME}"
|
||||
|
||||
- name: Checkout corresponding release branch
|
||||
run: |
|
||||
set -ue
|
||||
echo "Switching to release branch '${TARGET_BRANCH}'"
|
||||
if ! git checkout ${TARGET_BRANCH}; then
|
||||
echo "::error::Checking out release branch '${TARGET_BRANCH}' for target version '${TARGET_VERSION}' (tagged '${RELEASE_TAG}') failed. Does it exist in repo?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Create VERSION information
|
||||
run: |
|
||||
set -ue
|
||||
echo "Bumping version from $(cat VERSION) to ${TARGET_VERSION}"
|
||||
echo "${TARGET_VERSION}" > VERSION
|
||||
git commit -m "Bump version to ${TARGET_VERSION}" VERSION
|
||||
|
||||
- name: Generate new set of manifests
|
||||
run: |
|
||||
set -ue
|
||||
make install-codegen-tools-local
|
||||
helm2 init --client-only
|
||||
make manifests-local VERSION=${TARGET_VERSION}
|
||||
git diff
|
||||
git commit manifests/ -m "Bump version to ${TARGET_VERSION}"
|
||||
|
||||
- name: Create the release tag
|
||||
run: |
|
||||
set -ue
|
||||
echo "Creating release ${RELEASE_TAG}"
|
||||
git tag ${RELEASE_TAG}
|
||||
|
||||
- name: Build Docker image for release
|
||||
run: |
|
||||
set -ue
|
||||
git clean -fd
|
||||
mkdir -p dist/
|
||||
make image IMAGE_TAG="${TARGET_VERSION}" DOCKER_PUSH=false
|
||||
make release-cli
|
||||
chmod +x ./dist/argocd-linux-amd64
|
||||
./dist/argocd-linux-amd64 version --client
|
||||
if: ${{ env.DRY_RUN != 'true' }}
|
||||
|
||||
- name: Push docker image to repository
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }}
|
||||
DOCKER_TOKEN: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }}
|
||||
run: |
|
||||
set -ue
|
||||
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}"
|
||||
docker push ${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION}
|
||||
if: ${{ env.DRY_RUN != 'true' }}
|
||||
|
||||
- name: Read release notes file
|
||||
id: release-notes
|
||||
uses: juliangruber/read-file-action@v1
|
||||
with:
|
||||
path: ${{ env.RELEASE_NOTES }}
|
||||
|
||||
- name: Push changes to release branch
|
||||
run: |
|
||||
set -ue
|
||||
git push origin ${TARGET_BRANCH}
|
||||
git push origin ${RELEASE_TAG}
|
||||
|
||||
- name: Create GitHub release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
id: create_release
|
||||
with:
|
||||
tag_name: ${{ env.RELEASE_TAG }}
|
||||
release_name: ${{ env.RELEASE_TAG }}
|
||||
draft: ${{ env.DRAFT_RELEASE }}
|
||||
prerelease: ${{ env.PRE_RELEASE }}
|
||||
body: ${{ steps.release-notes.outputs.content }}
|
||||
|
||||
- name: Upload argocd-linux-amd64 binary to release assets
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./dist/argocd-linux-amd64
|
||||
asset_name: argocd-linux-amd64
|
||||
asset_content_type: application/octet-stream
|
||||
if: ${{ env.DRY_RUN != 'true' }}
|
||||
|
||||
- name: Upload argocd-darwin-amd64 binary to release assets
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./dist/argocd-darwin-amd64
|
||||
asset_name: argocd-darwin-amd64
|
||||
asset_content_type: application/octet-stream
|
||||
if: ${{ env.DRY_RUN != 'true' }}
|
||||
|
||||
- name: Upload argocd-windows-amd64 binary to release assets
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./dist/argocd-windows-amd64.exe
|
||||
asset_name: argocd-windows-amd64.exe
|
||||
asset_content_type: application/octet-stream
|
||||
if: ${{ env.DRY_RUN != 'true' }}
|
||||
|
||||
- name: Check out homebrew tap repository
|
||||
uses: actions/checkout@v2
|
||||
env:
|
||||
HOMEBREW_TOKEN: ${{ secrets.RELEASE_HOMEBREW_TOKEN }}
|
||||
with:
|
||||
repository: ${{ env.TAP_REPOSITORY }}
|
||||
path: homebrew-tap
|
||||
fetch-depth: 0
|
||||
token: ${{ env.HOMEBREW_TOKEN }}
|
||||
if: ${{ env.HOMEBREW_TOKEN != '' && env.UPDATE_HOMEBREW == 'true' && env.PRE_RELEASE != 'true' }}
|
||||
|
||||
- name: Update homebrew tap formula
|
||||
env:
|
||||
HOMEBREW_TOKEN: ${{ secrets.RELEASE_HOMEBREW_TOKEN }}
|
||||
run: |
|
||||
set -ue
|
||||
cd homebrew-tap
|
||||
./update.sh argocd ${TARGET_VERSION}
|
||||
git commit -am "Update argocd to ${TARGET_VERSION}"
|
||||
git push
|
||||
cd ..
|
||||
rm -rf homebrew-tap
|
||||
if: ${{ env.HOMEBREW_TOKEN != '' && env.UPDATE_HOMEBREW == 'true' && env.PRE_RELEASE != 'true' }}
|
||||
|
||||
- name: Delete original request tag from repository
|
||||
run: |
|
||||
set -ue
|
||||
git push --delete origin ${SOURCE_TAG}
|
||||
if: ${{ always() }}
|
||||
@@ -50,7 +50,7 @@ RUN groupadd -g 999 argocd && \
|
||||
chmod g=u /home/argocd && \
|
||||
chmod g=u /etc/passwd && \
|
||||
apt-get update && \
|
||||
apt-get install -y git git-lfs python3-pip && \
|
||||
apt-get install -y git git-lfs python3-pip tini && \
|
||||
apt-get clean && \
|
||||
pip3 install awscli==1.17.7 && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
@@ -395,11 +395,6 @@ func (ctrl *ApplicationController) managedResources(comparisonResult *comparison
|
||||
} else {
|
||||
item.TargetState = "null"
|
||||
}
|
||||
jsonDiff, err := resDiff.JSONFormat()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
item.Diff = jsonDiff
|
||||
item.PredictedLiveState = string(resDiff.PredictedLive)
|
||||
item.NormalizedLiveState = string(resDiff.NormalizedLive)
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import (
|
||||
"github.com/argoproj/gitops-engine/pkg/utils/io"
|
||||
kubeutil "github.com/argoproj/gitops-engine/pkg/utils/kube"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/yudai/gojsondiff"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
@@ -194,6 +193,9 @@ func DeduplicateTargetObjects(
|
||||
targetByKey := make(map[kubeutil.ResourceKey][]*unstructured.Unstructured)
|
||||
for i := range objs {
|
||||
obj := objs[i]
|
||||
if obj == nil {
|
||||
continue
|
||||
}
|
||||
isNamespaced := kubeutil.IsNamespacedOrUnknown(infoProvider, obj.GroupVersionKind().GroupKind())
|
||||
if !isNamespaced {
|
||||
obj.SetNamespace("")
|
||||
@@ -387,12 +389,7 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
|
||||
if i < len(diffResults.Diffs) {
|
||||
diffResult = diffResults.Diffs[i]
|
||||
} else {
|
||||
diffResult = diff.DiffResult{
|
||||
Diff: gojsondiff.New().CompareObjects(map[string]interface{}{}, map[string]interface{}{}),
|
||||
Modified: false,
|
||||
NormalizedLive: []byte("{}"),
|
||||
PredictedLive: []byte("{}"),
|
||||
}
|
||||
diffResult = diff.DiffResult{Modified: false, NormalizedLive: []byte("{}"), PredictedLive: []byte("{}")}
|
||||
}
|
||||
if resState.Hook || ignore.Ignore(obj) {
|
||||
// For resource hooks, don't store sync status, and do not affect overall sync status
|
||||
|
||||
@@ -1,5 +1,155 @@
|
||||
# Releasing
|
||||
|
||||
## Automated release procedure
|
||||
|
||||
Starting from `release-1.6` branch, ArgoCD can be released in automatic fashion
|
||||
using GitHub actions. The release process takes about 20 minutes, sometimes a
|
||||
little less, depending on the performance of GitHub actions runners.
|
||||
|
||||
The target release branch must already exist in GitHub repository. If you for
|
||||
example want to create a release `v1.7.0`, the corresponding release branch
|
||||
`release-1.7` needs to exist, otherwise the release cannot be build. Also,
|
||||
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
|
||||
with the latest information, and this change should be commited and pushed to
|
||||
the GitHub repository to the release branch. Afterwards, the automation can be
|
||||
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:**
|
||||
|
||||
* Update `VERSION` file in release branch
|
||||
* Update manifests with image tags of new version in release branch
|
||||
* Build the Docker image and push to Docker Hub
|
||||
* Create release tag in the GitHub repository
|
||||
* Create GitHub release and attach the required assets to it (CLI binaries, ...)
|
||||
|
||||
Finally, it will the remove trigger tag from repository again.
|
||||
|
||||
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
|
||||
Git uses it as comment char. To solve this, temporarily switch Git comment char
|
||||
to something else, the `;` character is recommended.
|
||||
|
||||
For example, considering you have configured the Git remote for repository to
|
||||
`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
|
||||
* Push tag to GitHub repository to trigger workflow
|
||||
* Remove trigger tag from your local repository
|
||||
|
||||
The script can be found at `hacks/trigger-release.sh` and is used as follows:
|
||||
|
||||
```shell
|
||||
./hacks/trigger-release.sh <version> <remote name> [<release notes path>]
|
||||
```
|
||||
|
||||
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
|
||||
enter the tag's annotation so you can paste the release notes, save and exit.
|
||||
It will also take care of temporarily configuring the `core.commentChar` and
|
||||
setting it back to its original state.
|
||||
|
||||
!!!note
|
||||
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
|
||||
execution. You can follow its progress under `Actions` tab, the name of the
|
||||
action is `Create release`. Don't get confused by the name of the running
|
||||
workflow, it will be the commit message of the latest commit to `master`
|
||||
branch, this is a limitation of GH actions.
|
||||
|
||||
The workflow performs necessary checks so that the release can be sucessfully
|
||||
build before the build actually starts. It will error when one of the
|
||||
prerequisites is not met, or if the release cannot be build (i.e. already
|
||||
exists, release notes invalid, etc etc). You can see a summary of what has
|
||||
failed in the job's overview page, and more detailed errors in the output
|
||||
of the step that has failed.
|
||||
|
||||
!!!note
|
||||
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
|
||||
example `v1.6.0` and `v1.7.0-rc1`, without problems.
|
||||
|
||||
### 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)
|
||||
to see if release has been correctly created, and if all required assets
|
||||
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.
|
||||
|
||||
* Delete release tag (i.e. `v1.6.0-rc2`) created on GitHub repository. This
|
||||
will immediately set release (if created) to `draft` status, invisible for
|
||||
general public.
|
||||
* Delete the draft release (if created) from `Releases` page on GitHub
|
||||
* If Docker image has been pushed to DockerHub, delete it
|
||||
* If commits have been performed to the release branch, revert them. Paths that could have been commited to are:
|
||||
* `VERSION`
|
||||
* `manifests/*`
|
||||
|
||||
### Post-process manual steps
|
||||
|
||||
For now, the only manual steps left are to
|
||||
|
||||
* update brew formulae for ArgoCD CLI on Mac if release is GA
|
||||
* update stable tag in GitHub repository to point to new release (if appropriate)
|
||||
|
||||
These will be automated as well in the future.
|
||||
|
||||
## Manual releasing
|
||||
|
||||
Automatic release process does not interfere with manual release process, since
|
||||
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:
|
||||
|
||||
Make sure you are logged into Docker Hub:
|
||||
|
||||
```bash
|
||||
@@ -42,18 +192,14 @@ git push $REPO $BRANCH
|
||||
git push $REPO $VERSION
|
||||
```
|
||||
|
||||
If GA, update `stable` tag:
|
||||
|
||||
```bash
|
||||
git tag stable --force && git push $REPO stable --force
|
||||
```
|
||||
|
||||
Update [Github releases](https://github.com/argoproj/argo-cd/releases) with:
|
||||
|
||||
* Getting started (copy from previous release)
|
||||
* Changelog
|
||||
* Binaries (e.g. `dist/argocd-darwin-amd64`).
|
||||
|
||||
## Update brew formulae (manual)
|
||||
|
||||
If GA, update Brew formula:
|
||||
|
||||
```bash
|
||||
@@ -64,7 +210,15 @@ git commit -am "Update argocd to $VERSION"
|
||||
git push
|
||||
```
|
||||
|
||||
### Verify
|
||||
## Update stable tag (manual)
|
||||
|
||||
If GA, update `stable` tag:
|
||||
|
||||
```bash
|
||||
git tag stable --force && git push $REPO stable --force
|
||||
```
|
||||
|
||||
## Verify release
|
||||
|
||||
Locally:
|
||||
|
||||
|
||||
4
go.mod
4
go.mod
@@ -8,7 +8,7 @@ require (
|
||||
github.com/TomOnTime/utfutil v0.0.0-20180511104225-09c41003ee1d
|
||||
github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 // indirect
|
||||
github.com/alicebob/miniredis v2.5.0+incompatible
|
||||
github.com/argoproj/gitops-engine v0.0.0-00010101000000-000000000000
|
||||
github.com/argoproj/gitops-engine v0.1.2
|
||||
github.com/argoproj/pkg v0.0.0-20200319004004-f46beff7cd54
|
||||
github.com/bsm/redislock v0.4.3
|
||||
github.com/casbin/casbin v1.9.1
|
||||
@@ -57,7 +57,6 @@ require (
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/stretchr/testify v1.5.1
|
||||
github.com/vmihailenco/msgpack v3.3.1+incompatible
|
||||
github.com/yudai/gojsondiff v1.0.1-0.20180504020246-0525c875b75c
|
||||
github.com/yuin/gopher-lua v0.0.0-20190115140932-732aa6820ec4
|
||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
|
||||
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9
|
||||
@@ -83,7 +82,6 @@ require (
|
||||
)
|
||||
|
||||
replace (
|
||||
github.com/argoproj/gitops-engine => github.com/argoproj/gitops-engine v0.1.1-0.20200601171118-4bd4f29670ee
|
||||
github.com/golang/protobuf => github.com/golang/protobuf v1.2.0
|
||||
github.com/grpc-ecosystem/grpc-gateway => github.com/grpc-ecosystem/grpc-gateway v1.3.1
|
||||
github.com/improbable-eng/grpc-web => github.com/improbable-eng/grpc-web v0.0.0-20181111100011-16092bd1d58a
|
||||
|
||||
4
go.sum
4
go.sum
@@ -50,8 +50,8 @@ github.com/alicebob/miniredis v2.5.0+incompatible h1:yBHoLpsyjupjz3NL3MhKMVkR41j
|
||||
github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||
github.com/argoproj/gitops-engine v0.1.1-0.20200601171118-4bd4f29670ee h1:oCQxH/zplZhggoIhXpBNJyx4F45CcSL6Hiyz4N2uJQU=
|
||||
github.com/argoproj/gitops-engine v0.1.1-0.20200601171118-4bd4f29670ee/go.mod h1:UmBGlQLT/MPNiMmbnouZRWhkk3slPuozMsENdXMkIMs=
|
||||
github.com/argoproj/gitops-engine v0.1.2 h1:tUDt0DR3axmHLmEJwgqWnr+cHHSK6cJLJef3YTLkQ+E=
|
||||
github.com/argoproj/gitops-engine v0.1.2/go.mod h1:UmBGlQLT/MPNiMmbnouZRWhkk3slPuozMsENdXMkIMs=
|
||||
github.com/argoproj/pkg v0.0.0-20200102163130-2dd1f3f6b4de/go.mod h1:2EZ44RG/CcgtPTwrRR0apOc7oU6UIw8GjCUJWZ8X3bM=
|
||||
github.com/argoproj/pkg v0.0.0-20200319004004-f46beff7cd54 h1:hDn02iEkh5EUl4TJfOo6AI9uSgh0vt/qh66ODuQl/YE=
|
||||
github.com/argoproj/pkg v0.0.0-20200319004004-f46beff7cd54/go.mod h1:2EZ44RG/CcgtPTwrRR0apOc7oU6UIw8GjCUJWZ8X3bM=
|
||||
|
||||
108
hack/trigger-release.sh
Executable file
108
hack/trigger-release.sh
Executable file
@@ -0,0 +1,108 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script requires bash shell - sorry.
|
||||
|
||||
NEW_TAG="${1}"
|
||||
GIT_REMOTE="${2}"
|
||||
COMMIT_MSG="${3}"
|
||||
origToken=""
|
||||
|
||||
set -ue
|
||||
|
||||
restoreToken() {
|
||||
if test "$origToken" != ""; then
|
||||
echo ">> Restoring original Git comment char"
|
||||
git config core.commentChar "$origToken"
|
||||
fi
|
||||
}
|
||||
|
||||
cleanLocalTriggerTag() {
|
||||
if test "$TRIGGER_TAG" != ""; then
|
||||
echo ">> Remove trigger tag '${TRIGGER_TAG}' from local repository."
|
||||
git tag -d $TRIGGER_TAG
|
||||
fi
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
restoreToken
|
||||
cleanLocalTriggerTag
|
||||
}
|
||||
|
||||
if test "${NEW_TAG}" = "" -o "${GIT_REMOTE}" = ""; then
|
||||
echo "!! Usage: $0 <release tag> <remote> [path to release notes file]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Target (version) tag must match version scheme vMAJOR.MINOR.PATCH with an
|
||||
# optional pre-release tag.
|
||||
if ! echo "${NEW_TAG}" | egrep -q '^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)*$'; then
|
||||
echo "!! Malformed version tag: '${NEW_TAG}', must match 'vMAJOR.MINOR.PATCH(-rcX)'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TRIGGER_TAG="release-${NEW_TAG}"
|
||||
|
||||
# Check whether we are in correct branch of local repository
|
||||
RELEASE_BRANCH="${NEW_TAG%\.[0-9]*}"
|
||||
RELEASE_BRANCH="release-${RELEASE_BRANCH#*v}"
|
||||
|
||||
currentBranch=$(git branch --show-current)
|
||||
if test "$currentBranch" != "${RELEASE_BRANCH}"; then
|
||||
echo "!! Please checkout branch '${RELEASE_BRANCH}' (currently in branch: '${currentBranch}')" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ">> Working in release branch '${RELEASE_BRANCH}'"
|
||||
|
||||
# Check for trigger tag existing in local repo
|
||||
if git tag -l | grep -q "${TRIGGER_TAG}"; then
|
||||
echo "!! Release tag '${TRIGGER_TAG}' already exists in local repository" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for trigger tag existing in remote repo
|
||||
if git ls-remote ${GIT_REMOTE} refs/tags/${TRIGGER_TAG} | grep -q ${NEW_TAG}; then
|
||||
echo "!! Target trigger tag '${TRIGGER_TAG}' already exists in remote '${GIT_REMOTE}'" >&2
|
||||
echo "!! Another operation currently in progress?" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for target (version) tag in local repo
|
||||
if git tag -l | grep -q "${NEW_TAG}"; then
|
||||
echo "!! Target version tag '${NEW_TAG}' already exists in local repository" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for target (version) tag in remote repo
|
||||
if git ls-remote ${GIT_REMOTE} refs/tags/${NEW_TAG} | grep -q ${NEW_TAG}; then
|
||||
echo "!! Target version tag '${NEW_TAG}' already exists in remote '${GIT_REMOTE}'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ">> Creating new release '${NEW_TAG}' by pushing '${TRIGGER_TAG}' to '${GIT_REMOTE}'"
|
||||
|
||||
GIT_ARGS=""
|
||||
if test "${COMMIT_MSG}" != ""; then
|
||||
if ! test -f "${COMMIT_MSG}"; then
|
||||
echo "!! Release notes at '${COMMIT_MSG}' do not exist or are not readable." >&2
|
||||
exit 1
|
||||
fi
|
||||
GIT_ARGS="-F ${COMMIT_MSG}"
|
||||
fi
|
||||
|
||||
# We need different git comment char than '#', because markdown makes extensive
|
||||
# use of '#' - we chose ';' for our operation.
|
||||
origToken=$(git config core.commentChar)
|
||||
echo ">> Saving original Git comment char '${origToken}' and setting it to ';' for this run"
|
||||
if ! git config core.commentChar ';'; then
|
||||
echo "!! Could not set git config commentChar ';'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap cleanup SIGINT EXIT
|
||||
|
||||
# Create trigger tag in local repository
|
||||
git tag -a ${GIT_ARGS} ${TRIGGER_TAG}
|
||||
|
||||
# Push the trigger tag to remote repository
|
||||
git push ${GIT_REMOTE} ${TRIGGER_TAG}
|
||||
@@ -12,4 +12,4 @@ bases:
|
||||
images:
|
||||
- name: argoproj/argocd
|
||||
newName: argoproj/argocd
|
||||
newTag: latest
|
||||
newTag: v1.6.0-rc2
|
||||
|
||||
@@ -18,4 +18,4 @@ bases:
|
||||
images:
|
||||
- name: argoproj/argocd
|
||||
newName: argoproj/argocd
|
||||
newTag: latest
|
||||
newTag: v1.6.0-rc2
|
||||
|
||||
@@ -2871,7 +2871,7 @@ spec:
|
||||
- "10"
|
||||
- --redis
|
||||
- argocd-redis-ha-haproxy:6379
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -2927,7 +2927,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd-util
|
||||
- /shared
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
volumeMounts:
|
||||
@@ -2977,7 +2977,7 @@ spec:
|
||||
- argocd-repo-server
|
||||
- --redis
|
||||
- argocd-redis-ha-haproxy:6379
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 5
|
||||
@@ -3045,7 +3045,7 @@ spec:
|
||||
- /shared/app
|
||||
- --redis
|
||||
- argocd-redis-ha-haproxy:6379
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -2786,7 +2786,7 @@ spec:
|
||||
- "10"
|
||||
- --redis
|
||||
- argocd-redis-ha-haproxy:6379
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -2842,7 +2842,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd-util
|
||||
- /shared
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
volumeMounts:
|
||||
@@ -2892,7 +2892,7 @@ spec:
|
||||
- argocd-repo-server
|
||||
- --redis
|
||||
- argocd-redis-ha-haproxy:6379
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 5
|
||||
@@ -2960,7 +2960,7 @@ spec:
|
||||
- /shared/app
|
||||
- --redis
|
||||
- argocd-redis-ha-haproxy:6379
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -2371,7 +2371,7 @@ spec:
|
||||
- "20"
|
||||
- --operation-processors
|
||||
- "10"
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -2427,7 +2427,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd-util
|
||||
- /shared
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
volumeMounts:
|
||||
@@ -2491,7 +2491,7 @@ spec:
|
||||
- argocd-repo-server
|
||||
- --redis
|
||||
- argocd-redis:6379
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 5
|
||||
@@ -2542,7 +2542,7 @@ spec:
|
||||
- argocd-server
|
||||
- --staticassets
|
||||
- /shared/app
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -2286,7 +2286,7 @@ spec:
|
||||
- "20"
|
||||
- --operation-processors
|
||||
- "10"
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -2342,7 +2342,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd-util
|
||||
- /shared
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
volumeMounts:
|
||||
@@ -2406,7 +2406,7 @@ spec:
|
||||
- argocd-repo-server
|
||||
- --redis
|
||||
- argocd-redis:6379
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 5
|
||||
@@ -2457,7 +2457,7 @@ spec:
|
||||
- argocd-server
|
||||
- --staticassets
|
||||
- /shared/app
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v1.6.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -522,7 +522,7 @@ func (s *Server) Patch(ctx context.Context, q *application.ApplicationPatchReque
|
||||
// Delete removes an application and all associated resources
|
||||
func (s *Server) Delete(ctx context.Context, q *application.ApplicationDeleteRequest) (*application.ApplicationResponse, error) {
|
||||
a, err := s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Get(*q.Name, metav1.GetOptions{})
|
||||
if err != nil && !apierr.IsNotFound(err) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -565,7 +565,7 @@ func (s *Server) Delete(ctx context.Context, q *application.ApplicationDeleteReq
|
||||
}
|
||||
|
||||
err = s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Delete(*q.Name, &metav1.DeleteOptions{})
|
||||
if err != nil && !apierr.IsNotFound(err) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
s.logAppEvent(a, ctx, argo.EventReasonResourceDeleted, "deleted application")
|
||||
|
||||
@@ -16,12 +16,14 @@ import (
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
kubetesting "k8s.io/client-go/testing"
|
||||
k8scache "k8s.io/client-go/tools/cache"
|
||||
"k8s.io/utils/pointer"
|
||||
|
||||
"github.com/argoproj/argo-cd/common"
|
||||
"github.com/argoproj/argo-cd/pkg/apiclient/application"
|
||||
@@ -308,6 +310,17 @@ func TestDeleteApp(t *testing.T) {
|
||||
assert.True(t, deleted)
|
||||
}
|
||||
|
||||
func TestDeleteApp_InvalidName(t *testing.T) {
|
||||
appServer := newTestAppServer()
|
||||
_, err := appServer.Delete(context.Background(), &application.ApplicationDeleteRequest{
|
||||
Name: pointer.StringPtr("foo"),
|
||||
})
|
||||
if !assert.Error(t, err) {
|
||||
return
|
||||
}
|
||||
assert.True(t, apierrors.IsNotFound(err))
|
||||
}
|
||||
|
||||
func TestSyncAndTerminate(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
appServer := newTestAppServer()
|
||||
|
||||
@@ -9,4 +9,10 @@ if ! whoami &> /dev/null; then
|
||||
fi
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
# If we're started as PID 1, we should wrap command execution through tini to
|
||||
# prevent leakage of orphaned processes ("zombies").
|
||||
if test "$$" = "1"; then
|
||||
exec tini -- $@
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user