Commit 327919d3 authored by Daniel Scholl's avatar Daniel Scholl
Browse files

Variable Script updates

parent 0e936798
......@@ -6,10 +6,26 @@ __PreRequisites__
Requires the use of [direnv](https://direnv.net/).
__Log with environment ServicePrincipal__
### Environment Variables
The application created for OSDU by default does not have a Client Secret and one must be manually created.
Copy the .envrc_sample file to .envrc and fill in the appropriate values.
```bash
# This logs your local Azure CLI in using the configured service principal.
az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant $ARM_TENANT_ID
Generate the environment yaml files `{service}/generate.sh` compatable with intelliJ [envfile](https://plugins.jetbrains.com/plugin/7861-envfile) plugin.
export DNS_HOST=<your_fqdn>
export COMMON_VAULT=<your_common_vault>
```
__Create Service Environment Variables__
Generate the environment .envrc and yaml files compatable with intelliJ [envfile](https://plugins.jetbrains.com/plugin/7861-envfile) plugin.
```bash
for SERVICE in partition entitlements-azure legal storage indexer-queue indexer-service search-service;
do
./$SERVICE.sh
done
```
......@@ -7,7 +7,7 @@
###############################
## ARGUMENT INPUT ##
###############################
usage() { echo "Usage: DNS_HOST=<your_host> INVALID_JWT=<your_token> entitlements.sh " 1>&2; exit 1; }
usage() { echo "Usage: DNS_HOST=<your_host> INVALID_JWT=<your_token> entitlements-azure.sh " 1>&2; exit 1; }
SERVICE="entitlements"
......@@ -21,6 +21,11 @@ if [ -z $DNS_HOST ]; then
usage;
fi
if [ -z $COMMON_VAULT ]; then
tput setaf 1; echo 'ERROR: COMMON_VAULT not provided' ; tput sgr0
usage;
fi
if [ -z $INVALID_JWT ]; then
tput setaf 1; echo 'ERROR: INVALID_JWT not provided' ; tput sgr0
usage;
......
......@@ -7,7 +7,7 @@
###############################
## ARGUMENT INPUT ##
###############################
usage() { echo "Usage: DNS_HOST=<your_host> INVALID_JWT=<your_token> indexer.sh " 1>&2; exit 1; }
usage() { echo "Usage: DNS_HOST=<your_host> INVALID_JWT=<your_token> indexer-service.sh " 1>&2; exit 1; }
SERVICE="indexer"
......@@ -21,6 +21,11 @@ if [ -z $DNS_HOST ]; then
usage;
fi
if [ -z $COMMON_VAULT ]; then
tput setaf 1; echo 'ERROR: COMMON_VAULT not provided' ; tput sgr0
usage;
fi
if [ -z $INVALID_JWT ]; then
tput setaf 1; echo 'ERROR: INVALID_JWT not provided' ; tput sgr0
usage;
......
......@@ -21,6 +21,11 @@ if [ -z $DNS_HOST ]; then
usage;
fi
if [ -z $COMMON_VAULT ]; then
tput setaf 1; echo 'ERROR: COMMON_VAULT not provided' ; tput sgr0
usage;
fi
if [ -z $INVALID_JWT ]; then
tput setaf 1; echo 'ERROR: INVALID_JWT not provided' ; tput sgr0
usage;
......
......@@ -21,17 +21,24 @@ if [ -z $DNS_HOST ]; then
usage;
fi
if [ -z $COMMON_VAULT ]; then
tput setaf 1; echo 'ERROR: COMMON_VAULT not provided' ; tput sgr0
usage;
fi
if [ -z $INVALID_JWT ]; then
tput setaf 1; echo 'ERROR: INVALID_JWT not provided' ; tput sgr0
usage;
fi
if [ -f ./settings_common.env ]; then
source ./settings_common.env;
else
tput setaf 1; echo 'ERROR: common.env not found' ; tput sgr0
fi
if [ -f ./settings_environment.env ]; then
source ./settings_environment.env;
else
......
......@@ -7,7 +7,7 @@
###############################
## ARGUMENT INPUT ##
###############################
usage() { echo "Usage: DNS_HOST=<your_host> INVALID_JWT=<your_token> search.sh " 1>&2; exit 1; }
usage() { echo "Usage: DNS_HOST=<your_host> INVALID_JWT=<your_token> search-service.sh " 1>&2; exit 1; }
SERVICE="search"
......@@ -21,6 +21,11 @@ if [ -z $DNS_HOST ]; then
usage;
fi
if [ -z $COMMON_VAULT ]; then
tput setaf 1; echo 'ERROR: COMMON_VAULT not provided' ; tput sgr0
usage;
fi
if [ -z $INVALID_JWT ]; then
tput setaf 1; echo 'ERROR: INVALID_JWT not provided' ; tput sgr0
usage;
......
......@@ -13,10 +13,10 @@ TENANT_ID="$(az account show --query tenantId -otsv)"
INVALID_JWT=$INVALID_JWT
# common-resources
NO_ACCESS_ID="$(az keyvault secret show --id https://$COMMON_VAULT.vault.azure.net/secrets/osdu-mvp-demo-noaccess-clientid --query value -otsv)"
NO_ACCESS_SECRET="$(az keyvault secret show --id https://$COMMON_VAULT.vault.azure.net/secrets/osdu-mvp-demo-noaccess-secret --query value -otsv)"
OTHER_APP_ID="$(az keyvault secret show --id https://$COMMON_VAULT.vault.azure.net/secrets/osdu-mvp-demo-application-clientid --query value -otsv)"
OTHER_APP_OID="$(az keyvault secret show --id https://$COMMON_VAULT.vault.azure.net/secrets/osdu-mvp-demo-application-oid --query value -otsv)"
NO_ACCESS_ID="$(az keyvault secret show --id https://$COMMON_VAULT.vault.azure.net/secrets/osdu-mvp-$UNIQUE-noaccess-clientid --query value -otsv)"
NO_ACCESS_SECRET="$(az keyvault secret show --id https://$COMMON_VAULT.vault.azure.net/secrets/osdu-mvp-$UNIQUE-noaccess-secret --query value -otsv)"
OTHER_APP_ID="$(az keyvault secret show --id https://$COMMON_VAULT.vault.azure.net/secrets/osdu-mvp-$UNIQUE-application-clientid --query value -otsv)"
OTHER_APP_OID="$(az keyvault secret show --id https://$COMMON_VAULT.vault.azure.net/secrets/osdu-mvp-$UNIQUE-application-oid --query value -otsv)"
## These values have to be setup in the Azure Tenant for testing MS Graph Items
AD_USER_EMAIL="$(az keyvault secret show --id https://$COMMON_VAULT.vault.azure.net/secrets/ad-user-email --query value -otsv)"
......
......@@ -21,6 +21,11 @@ if [ -z $DNS_HOST ]; then
usage;
fi
if [ -z $COMMON_VAULT ]; then
tput setaf 1; echo 'ERROR: COMMON_VAULT not provided' ; tput sgr0
usage;
fi
if [ -z $INVALID_JWT ]; then
tput setaf 1; echo 'ERROR: INVALID_JWT not provided' ; tput sgr0
usage;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment