Commit e0aeae5b authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

upgraded helm scripts with new environment optional file and improved help...

upgraded helm scripts with new environment optional file and improved help description on all of them
parent fe925409
Loading
Loading
Loading
Loading
Loading
+26 −6
Original line number Diff line number Diff line
#!/bin/bash
source $(dirname "$(readlink -f "$0")")/variables.sh

# Capture the first parameter as a possible environment
ENVIRONMENT="dev"
if [[ "$1" != -* && -n "$1" ]]; then
  ENVIRONMENT="$1"
  shift
fi

# Load variables for the selected environment
source "$(dirname "$0")/variables.sh" "$ENVIRONMENT"

# User to create
TOTAL_USERS=1
@@ -7,11 +16,20 @@ USERNAME_PREFIX=
USER_PASSWORD=

help() {
  echo "Usage: $1 <options>"
  echo "       -u : User prefix to use"
  echo "       -p : Password to set for user"
  echo "       -t : Total user to create (default 1)"  
  echo "       -h : show this help"
  echo "Usage: $0 [environment] [options]"
  echo ""
  echo "  environment         Optional. Environment name to use (e.g. dev, prod)."
  echo "                      If not specified, 'dev' will be used by default."
  echo ""
  echo "Options:"
  echo "  -u <prefix>         User prefix to use (required)"
  echo "  -p <password>       Password to set for user (required)"
  echo "  -t <total>          Total users to create (default: 1)"
  echo "  -h                  Show this help message"
  echo ""
  echo "Examples:"
  echo "  $0 prod -u testuser -p pass123 -t 5"
  echo "  $0 -u testuser -p pass123"
  exit 1
}

@@ -142,4 +160,6 @@ docker run -ti --rm --network="host" \
  --variable TOTAL_USERS:$TOTAL_USERS \
  --variable USERNAME_PREFIX:$USERNAME_PREFIX \
  --variable USER_PASSWORD:$USER_PASSWORD \
  --variable REGISTER_ADMIN_USER:$REGISTER_ADMIN_USER \
  --variable REGISTER_ADMIN_PASSWORD:$REGISTER_ADMIN_PASSWORD \
  --include create-users
+25 −7
Original line number Diff line number Diff line
#!/bin/bash
IP=""
NAMESPACE=""
source $(dirname "$(readlink -f "$0")")/variables.sh

# Capture the first parameter as a possible environment
ENVIRONMENT="dev"
if [[ "$1" != -* && -n "$1" ]]; then
  ENVIRONMENT="$1"
  shift
fi

# Load variables for the selected environment
source "$(dirname "$0")/variables.sh" "$ENVIRONMENT"

help() {
  echo "Usage: $1 <options>"
  echo "       -i : IP to use"
  echo "       -n : Namespace to get ingress information"
  echo "       -k : Kubeconfig to be used"
  echo "       -h : show this help"
  echo "Usage: $0 [environment] [options]"
  echo ""
  echo "  environment         Optional. Environment name to use (e.g. dev, prod)."
  echo "                      If not specified, 'dev' will be used by default."
  echo ""
  echo "Options:"
  echo "  -i <ip>             IP to use"
  echo "  -n <namespace>      Namespace to get ingress information"
  echo "  -k <kubeconfig>     Kubeconfig to be used"
  echo "  -h                  Show this help message"
  echo ""
  echo "Examples:"
  echo "  $0 prod -i 10.0.0.1 -n mynamespace"
  echo "  $0 -n mynamespace"
  exit 1
}
# Read params
# Process flags with getopts
while getopts ":i:n:k:h" opt; do
  case $opt in
    i)
+11 −1
Original line number Diff line number Diff line
#!/bin/bash
source $(dirname "$(readlink -f "$0")")/variables.sh


# Capture the first parameter as a possible environment
ENVIRONMENT="dev"
if [[ "$1" != -* && -n "$1" ]]; then
  ENVIRONMENT="$1"
  shift
fi

# Load variables for the selected environment
source "$(dirname "$0")/variables.sh" "$ENVIRONMENT"

helm repo add grafana https://grafana.github.io/helm-charts

+10 −1
Original line number Diff line number Diff line
#!/bin/bash
source $(dirname "$(readlink -f "$0")")/variables.sh

# Capture the first parameter as a possible environment
ENVIRONMENT="dev"
if [[ "$1" != -* && -n "$1" ]]; then
  ENVIRONMENT="$1"
  shift
fi

# Load variables for the selected environment
source "$(dirname "$0")/variables.sh" "$ENVIRONMENT"

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add grafana https://grafana.github.io/helm-charts
+10 −1
Original line number Diff line number Diff line
#!/bin/bash
source $(dirname "$(readlink -f "$0")")/variables.sh

# Capture the first parameter as a possible environment
ENVIRONMENT="dev"
if [[ "$1" != -* && -n "$1" ]]; then
  ENVIRONMENT="$1"
  shift
fi

# Load variables for the selected environment
source "$(dirname "$0")/variables.sh" "$ENVIRONMENT"

# Function to get the service status
get_service_status() {
Loading