From b427ae29bd6d0abc447d70fe082ceddfcc42a10e Mon Sep 17 00:00:00 2001 From: makefunstuff Date: Fri, 28 Jun 2024 18:54:07 +0300 Subject: it works!!!!!1111 --- scripts/argocd-admin-password | 40 ---------------------------------------- scripts/bootstrap | 5 +++++ scripts/create-secret | 24 ------------------------ scripts/deploy-argocd | 5 ----- scripts/setup-apps | 0 5 files changed, 5 insertions(+), 69 deletions(-) delete mode 100755 scripts/argocd-admin-password create mode 100755 scripts/bootstrap delete mode 100755 scripts/create-secret delete mode 100755 scripts/deploy-argocd delete mode 100644 scripts/setup-apps (limited to 'scripts') diff --git a/scripts/argocd-admin-password b/scripts/argocd-admin-password deleted file mode 100755 index da85088..0000000 --- a/scripts/argocd-admin-password +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# Ensure a secret name is provided -if [ -z "$1" ]; then - echo "Usage: $0 " - exit 1 -fi - -# Set the secret name -SECRET_NAME=$1 - -# Check if 1Password CLI is installed -if ! command -v op &> /dev/null; then - echo "1Password CLI (op) could not be found. Please install it first." - exit 1 -fi - -# Sign in to 1Password (ensure OP_SESSION_myaccount is set in the environment) -if [ -z "$OP_SESSION_myaccount" ]; then - eval $(op signin my) -fi - -# Retrieve the admin password from 1Password -ADMIN_PASSWORD=$(op read "op://Personal/$SECRET_NAME/password") - -if [ -z "$ADMIN_PASSWORD" ]; then - echo "Failed to retrieve the admin password from 1Password." - exit 1 -fi - -# Generate bcrypt hash of the password -HASHED_PASSWORD=$(htpasswd -nbBC 10 "" "$ADMIN_PASSWORD" | tr -d ':\n' | sed 's/$2y/$2a/') - -# Create the Kubernetes secret -kubectl create secret generic argocd-secret \ - --from-literal=admin.password=$HASHED_PASSWORD \ - -n argocd - -echo "ArgoCD admin password secret created successfully." - diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 0000000..aa0b3e5 --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e + +helm install argocd ./tools/argocd diff --git a/scripts/create-secret b/scripts/create-secret deleted file mode 100755 index d9aa929..0000000 --- a/scripts/create-secret +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e - -function createSecret() { - local secretName=$1 - local secretKey=$2 - local secretValue=$3 - - kubectl create secret generic $secretName --from-literal=$secretKey=$secretValue -} - -function help() { - echo "Usage: create-secret " -} - -case "$#" in - 3) - createSecret $1 $2 $3 - ;; - *) - help - ;; -esac diff --git a/scripts/deploy-argocd b/scripts/deploy-argocd deleted file mode 100755 index aa0b3e5..0000000 --- a/scripts/deploy-argocd +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -e - -helm install argocd ./tools/argocd diff --git a/scripts/setup-apps b/scripts/setup-apps deleted file mode 100644 index e69de29..0000000 -- cgit 1.4.1-2-gfad0