mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
chore: automate bundling argocd addons during release process (#8336)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ee97b7d96d
commit
b009cdb57d
@@ -27,23 +27,35 @@ if [ "$IMAGE_TAG" = "" ]; then
|
||||
IMAGE_TAG=latest
|
||||
fi
|
||||
|
||||
# bundle_with_addons bundles given kustomize base with either stable or latest version of addons
|
||||
function bundle_with_addons() {
|
||||
for addon in $(ls $SRCROOT/manifests/addons | grep -v README.md); do
|
||||
ADDON_BASE="latest"
|
||||
branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [[ $branch = release-* ]]; then
|
||||
ADDON_BASE="stable"
|
||||
fi
|
||||
rm -rf $SRCROOT/manifests/_tmp-bundle && mkdir -p $SRCROOT/manifests/_tmp-bundle
|
||||
cat << EOF >> $SRCROOT/manifests/_tmp-bundle/kustomization.yaml
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ../$1
|
||||
- ../addons/$addon/$ADDON_BASE
|
||||
EOF
|
||||
echo "${AUTOGENMSG}" > $2
|
||||
$KUSTOMIZE build $SRCROOT/manifests/_tmp-bundle >> $2
|
||||
done
|
||||
}
|
||||
|
||||
$KUSTOMIZE version
|
||||
|
||||
cd ${SRCROOT}/manifests/base && $KUSTOMIZE edit set image quay.io/argoproj/argocd=${IMAGE_NAMESPACE}/argocd:${IMAGE_TAG}
|
||||
cd ${SRCROOT}/manifests/ha/base && $KUSTOMIZE edit set image quay.io/argoproj/argocd=${IMAGE_NAMESPACE}/argocd:${IMAGE_TAG}
|
||||
cd ${SRCROOT}/manifests/core-install && $KUSTOMIZE edit set image quay.io/argoproj/argocd=${IMAGE_NAMESPACE}/argocd:${IMAGE_TAG}
|
||||
|
||||
echo "${AUTOGENMSG}" > "${SRCROOT}/manifests/install.yaml"
|
||||
$KUSTOMIZE build "${SRCROOT}/manifests/cluster-install" >> "${SRCROOT}/manifests/install.yaml"
|
||||
|
||||
echo "${AUTOGENMSG}" > "${SRCROOT}/manifests/namespace-install.yaml"
|
||||
$KUSTOMIZE build "${SRCROOT}/manifests/namespace-install" >> "${SRCROOT}/manifests/namespace-install.yaml"
|
||||
|
||||
echo "${AUTOGENMSG}" > "${SRCROOT}/manifests/ha/install.yaml"
|
||||
$KUSTOMIZE build "${SRCROOT}/manifests/ha/cluster-install" >> "${SRCROOT}/manifests/ha/install.yaml"
|
||||
|
||||
echo "${AUTOGENMSG}" > "${SRCROOT}/manifests/ha/namespace-install.yaml"
|
||||
$KUSTOMIZE build "${SRCROOT}/manifests/ha/namespace-install" >> "${SRCROOT}/manifests/ha/namespace-install.yaml"
|
||||
|
||||
echo "${AUTOGENMSG}" > "${SRCROOT}/manifests/core-install.yaml"
|
||||
$KUSTOMIZE build "${SRCROOT}/manifests/core-install" >> "${SRCROOT}/manifests/core-install.yaml"
|
||||
bundle_with_addons "cluster-install" "${SRCROOT}/manifests/install.yaml"
|
||||
bundle_with_addons "namespace-install" "${SRCROOT}/manifests/namespace-install.yaml"
|
||||
bundle_with_addons "ha/cluster-install" "${SRCROOT}/manifests/ha/install.yaml"
|
||||
bundle_with_addons "ha/namespace-install" "${SRCROOT}/manifests/ha/namespace-install.yaml"
|
||||
bundle_with_addons "core-install" "${SRCROOT}/manifests/core-install.yaml"
|
||||
|
||||
1
manifests/.gitignore
vendored
Normal file
1
manifests/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_tmp-bundle
|
||||
5
manifests/addons/README.md
Normal file
5
manifests/addons/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Addons
|
||||
|
||||
Directory contains Kustomize manifests of bundled Argo CD addons. Each directory must include the latest and stable versions
|
||||
of the installation manifests in the directories named accordingly. The stable version should point to a particular git
|
||||
tag and must be updated prior to each release.
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- https://raw.githubusercontent.com/argoproj/applicationset/v0.3.0/manifests/install.yaml
|
||||
@@ -11,7 +11,6 @@ resources:
|
||||
- ./dex
|
||||
- ./repo-server
|
||||
- ./server
|
||||
- ./applicationset
|
||||
- ./config
|
||||
- ./redis
|
||||
- ./notification
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,6 @@ resources:
|
||||
- ../../base/dex
|
||||
- ../../base/repo-server
|
||||
- ../../base/server
|
||||
- ../../base/applicationset
|
||||
- ../../base/config
|
||||
- ../../base/notification
|
||||
- ./redis-ha
|
||||
|
||||
@@ -132,7 +132,7 @@ func TestGenerateYamlManifestInDir(t *testing.T) {
|
||||
q := apiclient.ManifestRequest{Repo: &argoappv1.Repository{}, ApplicationSource: &src}
|
||||
|
||||
// update this value if we add/remove manifests
|
||||
const countOfManifests = 47
|
||||
const countOfManifests = 41
|
||||
|
||||
res1, err := service.GenerateManifest(context.Background(), &q)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user