<commit_before>#!/usr/bin/env bash

# Example :
# Token                         --> ./quickstart_vertx_secured.sh -a https://api.engint.openshift.com -t xxxxxxxxxxxx -c http://secured-vertx-rest-ssovertx.e8ca.engint.openshiftapps.com -s https://secure-sso-ssovertx.e8ca.engint.openshiftapps.com
# User/password                 --> ./quickstart_vertx_secured.sh -a https://172.16.50.40:8443 -u admin -p admin -c http://secured-vertx-rest-ssovertx.172.16.50.40.xip.io -s https://secure-sso-ssovertx.172.16.50.40.xip.io
# User/password (local vagrant) --> ./quickstart_vertx_secured.sh -a 172.28.128.4:8443 -u admin -p admin -c http://secured-vertx-rest-ssovertx.172.28.128.4.xip.io -s https://secure-sso-ssovertx.172.28.128.4.xip.io
# Minishift                     --> ./quickstart_vertx_secured.sh -a 192.168.64.25:8443 -u admin -p admin -c http://secured-vertx-rest-ssovertx.192.168.64.25:8443.xip.io -s https://secure-sso-ssovertx.192.168.64.25:8443.xip.io
#
# ./httpie/token_req.sh https://secure-sso-ssovertx.172.28.128.4.xip.io http://secured-vertx-rest-ssovertx.172.28.128.4.xip.io

while getopts a:t:u:p:c:s: option
do
        case "${option}"
        in
                a) api=${OPTARG};;
                t) token=${OPTARG};;
                u) user=${OPTARG};;
                p) password=${OPTARG};;
                c) app=${OPTARG};;
                s) sso=${OPTARG};;
        esac
done

current=$PWD
http_code=200

echo "# Quickstart - Secured Vert.x with Red Hat SSO"
if [ "$token" != "" ]; then
   oc login $api --token=$token
else
   echo "oc login $api -u $user -p $password"
   oc login $api -u $user -p $password
fi

oc project default
oc delete project ssovertx --now=true
sleep 3
oc new-project ssovertx

rm -rf $TMPDIR/quick* && cd $TMPDIR
git clone https://github.com/obsidian-toaster-quickstarts/secured_rest-vertx.git
cd secured_rest-vertx
mvn clean install -Popenshift -Dobs.scm.git.connection="scm:git:git://github.com/obsidian-tester/secured_rest-vertx.git" \
-Dobs.scm.dev.connection="scm:git:git@github.<EMAIL>:obsidian-tester/secured_rest-vertx.git" \
-Dobs.scm.url="http://github.com/obsidian-tester/secured_rest-vertx" \
-Dobs.scm.tag="HEAD"
cd sso
mvn fabric8:deploy -Popenshift -Dobs.scm.git.connection="scm:git:git://github.com/obsidian-tester/secured_rest-vertx.git" \
-Dobs.scm.dev.connection="scm:git:git@github.com:obsidian-tester/secured_rest-vertx.git" \
-Dobs.scm.url="http://github.com/obsidian-tester/secured_rest-vertx" \
-Dobs.scm.tag="HEAD"

oc env dc/secured-vertx-rest SSO_URL=$sso
oc env dc/secured-vertx-rest REALM=master
oc env dc/secured-vertx-rest REALM_PUBLIC_KEY=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjSLQrbpwNkpuNc+LxcrG711/oIsqUshISLWjXALgx6/L7NItNrPjJTwzqtWCTJrl0/eQLcPdi7UeZA1qjPGa1l+AIj+FnLyCOl7gm65xB3xUpRuGNe5mJ9a+ZtzprXOKhd0WRC8ydiMwyFxIQJPjt7ywlNvU0hZR1U3QboLRICadP5WPaoYNOaYmpkX34r+kegVfdga+1xqG6Ba5v2/9rRg74KxJubCQxcinbH7gVIYSyFQPP5OpBo14SuynFL1YhWDpgUhLz7gr60sG+RC5eC0zuvCRTELn+JquSogPUopuDej/Sd3T5VYHIBJ8P4x4MIz9/FDX8bOFwM73nHgL5wIDAQAB
oc env dc/secured-vertx-rest CLIENT_ID=demoapp
oc env dc/secured-vertx-rest SECRET=cb7a8528-ad53-4b2e-afb8-72e9795c27c8
cd ../<commit_msg>Update key. Echo values<commit_after>#!/usr/bin/env bash

# Example :
# Token                         --> ./quickstart_vertx_secured.sh -a https://api.engint.openshift.com -t xxxxxxxxxxxx -c http://secured-vertx-rest-ssovertx.e8ca.engint.openshiftapps.com -s https://secure-sso-ssovertx.e8ca.engint.openshiftapps.com
# User/password                 --> ./quickstart_vertx_secured.sh -a https://172.16.50.40:8443 -u admin -p admin -c http://secured-vertx-rest-ssovertx.172.16.50.40.xip.io -s https://secure-sso-ssovertx.172.16.50.40.xip.io
# User/password (local vagrant) --> ./quickstart_vertx_secured.sh -a 172.28.128.4:8443 -u admin -p admin -c http://secured-vertx-rest-ssovertx.172.28.128.4.xip.io -s https://secure-sso-ssovertx.172.28.128.4.xip.io
# Minishift                     --> ./quickstart_vertx_secured.sh -a 192.168.64.25:8443 -u admin -p admin -c http://secured-vertx-rest-ssovertx.192.168.64.25:8443.xip.io -s https://secure-sso-ssovertx.192.168.64.25:8443.xip.io
#
# ./httpie/token_req.sh https://secure-sso-ssovertx.172.28.128.4.xip.io http://secured-vertx-rest-ssovertx.172.28.128.4.xip.io

while getopts a:t:u:p:c:s: option
do
        case "${option}"
        in
                a) api=${OPTARG};;
                t) token=${OPTARG};;
                u) user=${OPTARG};;
                p) password=${OPTARG};;
                c) app=${OPTARG};;
                s) sso=${OPTARG};;
        esac
done

current=$PWD
http_code=200
echo "================================================================================"
echo "Openshift --> Api: $api, Token: $token, User: $user, Password: <PASSWORD>"
echo "App: $app"
echo "sso: $sso"
echo "================================================================================"

echo "# Quickstart - Secured Vert.x with Red Hat SSO"
if [ "$token" != "" ]; then
   oc login $api --token=$token
else
   echo "oc login $api -u $user -p $password"
   oc login $api -u $user -p $password
fi

oc project default
oc delete project ssovertx --now=true
sleep 3
oc new-project ssovertx

rm -rf $TMPDIR/quick* && cd $TMPDIR
git clone https://github.com/obsidian-toaster-quickstarts/secured_rest-vertx.git

cd secured_rest-vertx
mvn clean install -Popenshift

cd sso
mvn fabric8:deploy -Popenshift

oc env dc/secured-vertx-rest SSO_URL=$sso
oc env dc/secured-vertx-rest REALM=master
oc env dc/secured-vertx-rest REALM_PUBLIC_KEY=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjoVg6150oqh7csrGMsttu7r+s4YBkYDkKrg2v6Gd5NhJw9NKnFlojPnLPoDSlxpNpN2sWegexcsFdDdmtuMzTxQ3hnkFWHDDXsyfj2fKQwDjgcxg95nRaaI+/OGhWbEsGdt/A5jxg2f4Vp4VLTwCj7Ujq4hVx67vO/zbJ2k0cD2uz5T731tvqweC7H/Os+G8B1+PpH5e1jGkDPZohe4ERCEdwNcC9IAt1tPr/LKfh+84hOkE3i9mGG/LGUiJShtw7ia2jXTMb1JErlJsLJOjh+guz6OztQOICN//+rRA4AACB//+IeJ8mr/jN/dww+RfYyeAd/SId56ae8H4SE4HQQIDAQAB
oc env dc/secured-vertx-rest CLIENT_ID=demoapp
oc env dc/secured-vertx-rest SECRET=cb7a8528-ad53-4b2e-afb8-72e9795c27c8

cd ../
{'fraction_non_alphanumeric': 0.16969897452861396, 'fraction_numerical': 0.0673172345352299, 'mean_word_length': 3.5880121396054627, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 23, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7239139', 'n_tokens_mistral': 2891, 'n_tokens_neox': 2599, 'n_words': 355}