Skip to content

Commit

Permalink
feat: add postgres option (#6557)
Browse files Browse the repository at this point in the history
* feat: add postgres option

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* feat: allow postgres option

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

---------

Signed-off-by: Amro Misbah <amromisba7@gmail.com>
  • Loading branch information
misba7 committed Nov 16, 2023
1 parent 1b2fa6f commit ed47585
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
29 changes: 24 additions & 5 deletions automation/startjanssendemo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ if ! [[ $JANS_FQDN == *"."*"."* ]]; then
exit 1
fi
if [[ ! "$JANS_PERSISTENCE" ]]; then
read -rp "Enter persistence type [LDAP|MYSQL]: " JANS_PERSISTENCE
read -rp "Enter persistence type [LDAP|MYSQL|PGSQL]: " JANS_PERSISTENCE
fi
if [[ $JANS_PERSISTENCE != "LDAP" ]] && [[ $JANS_PERSISTENCE != "MYSQL" ]]; then
echo "[E] Incorrect entry. Please enter either LDAP or MYSQL"
if [[ $JANS_PERSISTENCE != "LDAP" ]] && [[ $JANS_PERSISTENCE != "MYSQL" ]] && [[ $JANS_PERSISTENCE != "PGSQL" ]]; then
echo "[E] Incorrect entry. Please enter either LDAP, MYSQL or PGSQL"
exit 1
fi

Expand Down Expand Up @@ -72,9 +72,8 @@ fi

PERSISTENCE_TYPE="sql"
if [[ $JANS_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=jans bitnami/mysql -n jans --kubeconfig="$KUBECONFIG"
sudo helm install my-release --set auth.rootPassword=Test1234#,auth.database=jans -n jans oci://registry-1.docker.io/bitnamicharts/mysql --kubeconfig="$KUBECONFIG"
cat << EOF > override.yaml
config:
countryCode: US
Expand All @@ -92,6 +91,26 @@ config:
EOF
fi

if [[ $JANS_PERSISTENCE == "PGSQL" ]]; then
sudo microk8s.kubectl get po --kubeconfig="$KUBECONFIG"
sudo helm install my-release --set auth.postgresPassword=Test1234#,auth.database=jans -n jans 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: jans
cnSqlDbPort: 5432
cnSqlDbDialect: pgsql
cnSqlDbHost: my-release-postgresql.jans.svc
cnSqlDbUser: postgres
cnSqlDbTimezone: UTC
cnSqldbUserPassword: Test1234#
EOF
fi

ENABLE_LDAP="false"
if [[ $JANS_PERSISTENCE == "LDAP" ]]; then
openssl req \
Expand Down
2 changes: 1 addition & 1 deletion charts/janssen/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"cnSqlDbDialect": {
"description": "SQL dialect",
"type": "string",
"pattern": "^(mysql)$"
"pattern": "^(mysql|pgsql)$"
},
"cnSqlDbHost": {
"description": "SQL server address or ip",
Expand Down

0 comments on commit ed47585

Please sign in to comment.