Newer
Older
#!/usr/bin/env bash
set -euo pipefail
# shellcheck source=install/flux-version-check.sh
. "$(dirname "$0")/flux-version-check.sh"
flux install \
--network-policy=false \
--watch-all-namespaces=true \
--namespace=flux-system \
--components="source-controller,kustomize-controller,helm-controller"
kubectl patch deployment \
-n flux-system \
helm-controller \
--patch-file "$(dirname "$0")/flux-patches/helm-controller.yaml"
kubectl patch deployment \
-n flux-system \
source-controller \
--patch-file "$(dirname "$0")/flux-patches/source-controller.yaml"
branch=${CI_COMMIT_REF_NAME:-}
[ -z "$branch" ] && branch=$(git rev-parse --abbrev-ref HEAD)
echo "Tracking branch $branch for https://open.greenhost.net/stackspin/stackspin flux repo"
# Create stackspin and stackspin-apps namespaces
kubectl get namespace stackspin 2>/dev/null || kubectl create namespace stackspin
kubectl get namespace stackspin-apps 2>/dev/null || kubectl create namespace stackspin-apps
# Generate oauth and SSO secrets
python "$(dirname "$0")/generate_secrets.py" single-sign-on

Maarten de Waard
committed
python "$(dirname "$0")/generate_secrets.py" oauth
python "$(dirname "$0")/generate_secrets.py" kube-prometheus-stack
python "$(dirname "$0")/generate_secrets.py" prometheus
python "$(dirname "$0")/generate_secrets.py" alertmanager
flux create source git stackspin \
--url=https://open.greenhost.net/stackspin/stackspin \
flux create kustomization stackspin \
--source=GitRepository/stackspin \