Skip to content

Commit

Permalink
add prefix for dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mechevarria committed Feb 25, 2021
1 parent e63d8bb commit b0fa8b4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
9 changes: 9 additions & 0 deletions cf-keycloak.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/usr/bin/env bash

space=$(cf target | awk '{print $2}' | sed -n 5p)

if [[ $space = "rtwp" ]]; then
echo "Deploying to the ${space} space"
else
echo "Login to the 'rtwp' space before deploying keycloak './cf-login.sh rtwp'"
exit 1
fi

app=rtwp-keycloak

cf push $app \
Expand Down
2 changes: 1 addition & 1 deletion cf-login.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ api_url=https://api.cf.us10.hana.ondemand.com
username=$CP_USER
password=$CP_PASSWORD
org=ns2-presales
space=rtwp
space=$1

cf login -a $api_url -u $username -p $password -o $org -s $space
15 changes: 7 additions & 8 deletions cf-rtwp-admin.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#!/usr/bin/env bash

status=$(cf app rtwp-keycloak | sed -n 3p)
if [[ $status = "FAILED" ]]; then
prefix=$1-

if [[ -z "${KEYCLOAK_URL}" ]]; then
echo "KEYCLOAK_URL environment variable is not set'"
exit 1
else
keycloak_url=https://$(cf app rtwp-keycloak | awk '{print $2}' | sed -n 5p)/auth
echo keycloak_url=$keycloak_url
fi

status=$(cf app rtwp-api | sed -n 3p)
status=$(cf app ${prefix}rtwp-api | sed -n 3p)
if [[ $status = "FAILED" ]]; then
exit 1
else
express_url=https://$(cf app rtwp-api | awk '{print $2}' | sed -n 5p)/
express_url=https://$(cf app ${prefix}rtwp-api | awk '{print $2}' | sed -n 5p)/
echo express_url=$express_url
fi

app=rtwp-admin
app=${prefix}rtwp-admin

cd rtwp-admin

Expand Down
11 changes: 5 additions & 6 deletions cf-rtwp-api.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/usr/bin/env bash

status=$(cf app rtwp-keycloak | sed -n 3p)
if [[ $status = "FAILED" ]]; then
prefix=$1-

if [[ -z "${KEYCLOAK_URL}" ]]; then
echo "KEYCLOAK_URL environment variable is not set'"
exit 1
else
keycloak_url=https://$(cf app rtwp-keycloak | awk '{print $2}' | sed -n 5p)/auth
echo keycloak_url=$keycloak_url
fi

service=rtwp-hdi-hana
Expand All @@ -14,7 +13,7 @@ if [[ $status = "FAILED" ]]; then
exit 1
fi

app=rtwp-api
app=${prefix}rtwp-api

cd rtwp-api

Expand Down

0 comments on commit b0fa8b4

Please sign in to comment.