From d0b4c1bebb34931275d8e34338ebfa508eeaea6f Mon Sep 17 00:00:00 2001 From: Matt Conway Date: Tue, 23 Nov 2021 17:10:31 -0500 Subject: [PATCH] get gihub actions working --- install/argocd-cm.patch.yaml | 2 +- install/argocd-repo-server.patch.yaml | 13 +++++-------- install/install.sh | 25 ------------------------- install/setup.sh | 25 +++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 34 deletions(-) delete mode 100644 install/install.sh create mode 100755 install/setup.sh diff --git a/install/argocd-cm.patch.yaml b/install/argocd-cm.patch.yaml index c9c12a1..9cc125c 100644 --- a/install/argocd-cm.patch.yaml +++ b/install/argocd-cm.patch.yaml @@ -3,4 +3,4 @@ data: - name: argocd-cloudtruth-plugin generate: command: ["argocd-cloudtruth-plugin"] - args: ["./**/*.y*ml"] + args: ["*.y*ml"] diff --git a/install/argocd-repo-server.patch.yaml b/install/argocd-repo-server.patch.yaml index b142bf0..338ca41 100644 --- a/install/argocd-repo-server.patch.yaml +++ b/install/argocd-repo-server.patch.yaml @@ -10,11 +10,8 @@ spec: - name: argocd-repo-server volumeMounts: - name: custom-tools - subPath: cloudtruth - mountPath: /usr/local/bin/cloudtruth - - name: custom-tools - subPath: argoct.sh - mountPath: /usr/local/bin/argoct.sh + subPath: argocd-cloudtruth-plugin + mountPath: /usr/local/bin/argocd-cloudtruth-plugin envFrom: - secretRef: name: argocd-cloudtruth-plugin @@ -22,11 +19,11 @@ spec: - name: custom-tools emptyDir: {} initContainers: - - name: download-tools - image: alpine:3.8 + - name: install-argocd-cloudtruth-plugin + image: cloudtruth/argocd-cloudtruth-plugin command: [sh, -c] args: - - wget -qO- https://github.com/cloudtruth/cloudtruth-cli/releases/latest/download/install.sh | sh && cp /usr/local/bin/cloudtruth /custom-tools/ && cp /local/argoct.sh /custom-tools/ && echo 2 + - cp /argocd-cloudtruth-plugin /custom-tools/ volumeMounts: - name: custom-tools mountPath: /custom-tools diff --git a/install/install.sh b/install/install.sh deleted file mode 100644 index 5cd60f7..0000000 --- a/install/install.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -# fail fast -set -e - - -print "Input Cloudtruth Api Key: " -read CLOUDTRUTH_API_KEY -print "Input Cloudtruth Environment (Default for all Argo projects): " -read CLOUDTRUTH_ENVIRONMENT -print "Input Cloudtruth Project (Default for all Argo projects): " -read CLOUDTRUTH_PROJECT - -secret_yaml <<-EOF -$(cat argocd-cloudtruth-plugin-secret.yaml) - CLOUDTRUTH_API_KEY: $CLOUDTRUTH_API_KEY - CLOUDTRUTH_ENVIRONMENT: $CLOUDTRUTH_ENVIRONMENT - CLOUDTRUTH_PROJECT: $CLOUDTRUTH_PROJECT -EOF - -# --type merge ? -# --dry-run=server -o yaml -echo ${secret_yaml} | kubectl apply -n argocd -f - -kubectl patch -n argocd deployment/argocd-repo-server --patch "$(cat argocd-repo-server.patch.yaml)" -kubectl patch -n argocd configmap/argocd-cm --patch "$(cat argocd-cm.patch.yaml)" diff --git a/install/setup.sh b/install/setup.sh new file mode 100755 index 0000000..420a280 --- /dev/null +++ b/install/setup.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# fail fast +set -e + + +printf "Input Cloudtruth Api Key: " +read CLOUDTRUTH_API_KEY +printf "Input Cloudtruth Environment (Default and can be overridden for each Argo project): " +read CLOUDTRUTH_ENVIRONMENT +printf "Input Cloudtruth Project (Default and can be overridden for each Argo project): " +read CLOUDTRUTH_PROJECT + +cat < argocd-repo-server.original.$(date +%s).yaml +kubectl patch -n argocd deployment/argocd-repo-server --patch "$(cat argocd-repo-server.patch.yaml)" + +kubectl get -n argocd configmap/argocd-cm -o yaml > argocd-cm..original.$(date +%s).yaml +kubectl patch -n argocd configmap/argocd-cm --patch "$(cat argocd-cm.patch.yaml)"