Skip to content

Commit

Permalink
feat: encode licenseSsa (#1443)
Browse files Browse the repository at this point in the history
  • Loading branch information
misba7 authored Nov 9, 2023
1 parent a4fa0ef commit 64c02f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions automation/startflexdemo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [[ $GLUU_PERSISTENCE != "LDAP" ]] && [[ $GLUU_PERSISTENCE != "MYSQL" ]]; then
exit 1
fi
if [[ ! "$GLUU_LICENSE_SSA" ]]; then
read -rp "Enter base64 encoded licenseSsa: " GLUU_LICENSE_SSA
read -rp "Enter the License SSA provided by Gluu: " GLUU_LICENSE_SSA
fi
LOG_TARGET="FILE"
LOG_LEVEL="TRACE"
Expand Down Expand Up @@ -128,9 +128,10 @@ EOF
fi

echo "$EXT_IP $GLUU_FQDN" | sudo tee -a /etc/hosts > /dev/null
ENCODED_GLUU_LICENSE_SSA=$(echo -n "$GLUU_LICENSE_SSA" | base64 -w0)
cat << EOF >> override.yaml
global:
licenseSsa: $GLUU_LICENSE_SSA
licenseSsa: $ENCODED_GLUU_LICENSE_SSA
cloud:
testEnviroment: true
istio:
Expand Down
6 changes: 3 additions & 3 deletions automation/startflexmonolithdemo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [[ -z $EXT_IP ]]; then
fi

if [[ ! "$GLUU_LICENSE_SSA" ]]; then
read -rp "Enter the License SSA in base64 format provided from Gluu: " GLUU_LICENSE_SSA
read -rp "Enter the License SSA provided by Gluu: " GLUU_LICENSE_SSA
fi
sudo apt-get update
# Install Docker and Docker compose plugin
Expand Down Expand Up @@ -69,8 +69,8 @@ if [[ "$FLEX_BUILD_COMMIT" ]]; then

python3 -c "from pathlib import Path ; import ruamel.yaml ; compose = Path('/tmp/flex/docker-flex-monolith/flex-ldap-compose.yml') ; yaml = ruamel.yaml.YAML() ; data = yaml.load(compose) ; data['services']['flex']['build'] = '.' ; del data['services']['flex']['image'] ; yaml.dump(data, compose)"
fi

python3 -c "from dockerfile_parse import DockerfileParser ; dfparser = DockerfileParser('/tmp/flex/docker-flex-monolith') ; dfparser.envs['CN_GLUU_LICENSE_SSA'] = '$GLUU_LICENSE_SSA'"
ENCODED_GLUU_LICENSE_SSA=$(echo -n "$GLUU_LICENSE_SSA" | base64 -w0)
python3 -c "from dockerfile_parse import DockerfileParser ; dfparser = DockerfileParser('/tmp/flex/docker-flex-monolith') ; dfparser.envs['CN_GLUU_LICENSE_SSA'] = '$ENCODED_GLUU_LICENSE_SSA'"
# --
if [[ $GLUU_PERSISTENCE == "MYSQL" ]]; then
docker compose -f /tmp/flex/docker-flex-monolith/flex-mysql-compose.yml up -d
Expand Down

0 comments on commit 64c02f3

Please sign in to comment.