Skip to content

Commit

Permalink
feat: support postgres in flex script (#1449)
Browse files Browse the repository at this point in the history
* feat: support postgres in flex script

* feat: change POSTGRESQL to PGSQL
  • Loading branch information
misba7 authored Nov 15, 2023
1 parent 43539ff commit fabf7a0
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions automation/startflexdemo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ if ! [[ $GLUU_FQDN == *"."*"."* ]]; then
exit 1
fi
if [[ ! "$GLUU_PERSISTENCE" ]]; then
read -rp "Enter persistence type [LDAP|MYSQL]: " GLUU_PERSISTENCE
read -rp "Enter persistence type [LDAP|MYSQL|PGSQL]: " GLUU_PERSISTENCE
fi
if [[ $GLUU_PERSISTENCE != "LDAP" ]] && [[ $GLUU_PERSISTENCE != "MYSQL" ]]; then
echo "[E] Incorrect entry. Please enter either LDAP or MYSQL"
if [[ $GLUU_PERSISTENCE != "LDAP" ]] && [[ $GLUU_PERSISTENCE != "MYSQL" ]] && [[ $GLUU_PERSISTENCE != "PGSQL" ]]; then
echo "[E] Incorrect entry. Please enter either LDAP, MYSQL or PGSQL"
exit 1
fi
if [[ ! "$GLUU_LICENSE_SSA" ]]; then
Expand Down Expand Up @@ -75,9 +75,8 @@ fi

PERSISTENCE_TYPE="sql"
if [[ $GLUU_PERSISTENCE == "MYSQL" ]]; then
sudo helm repo add bitnami https://charts.bitnami.com/bitnami
sudo microk8s.kubectl get po --kubeconfig="$KUBECONFIG"
sudo helm install my-release --set auth.rootPassword=Test1234#,auth.database=gluu bitnami/mysql -n gluu --kubeconfig="$KUBECONFIG"
sudo helm install my-release --set auth.rootPassword=Test1234#,auth.database=gluu -n gluu oci://registry-1.docker.io/bitnamicharts/mysql --kubeconfig="$KUBECONFIG"
cat << EOF > override.yaml
config:
countryCode: US
Expand All @@ -94,7 +93,25 @@ config:
cnSqldbUserPassword: Test1234#
EOF
fi

if [[ $GLUU_PERSISTENCE == "PGSQL" ]]; then
sudo microk8s.kubectl get po --kubeconfig="$KUBECONFIG"
sudo helm install my-release --set auth.postgresPassword=Test1234#,auth.database=gluu -n gluu oci://registry-1.docker.io/bitnamicharts/postgresql --kubeconfig="$KUBECONFIG"
cat << EOF > override.yaml
config:
countryCode: US
email: support@gluu.org
orgName: Gluu
city: Austin
configmap:
cnSqlDbName: gluu
cnSqlDbPort: 5432
cnSqlDbDialect: pgsql
cnSqlDbHost: my-release-postgresql.gluu.svc
cnSqlDbUser: postgres
cnSqlDbTimezone: UTC
cnSqldbUserPassword: Test1234#
EOF
fi
ENABLE_LDAP="false"
if [[ $GLUU_PERSISTENCE == "LDAP" ]]; then
openssl req \
Expand Down

0 comments on commit fabf7a0

Please sign in to comment.