-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added -O to overwrite secret creation. Added conditional around testi…
…ng agbot status for only local tests Signed-off-by: Ben Courliss <[email protected]>
- Loading branch information
Ben Courliss
committed
Aug 18, 2021
1 parent
ad45435
commit d80725b
Showing
2 changed files
with
25 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
#!/bin/bash | ||
# First create the secret that the service will need | ||
|
||
# if [ "${EXCH_APP_HOST}" != "http://exchange-api:8081/v1" ]; then | ||
# exit 0 | ||
# fi | ||
|
||
if [ "${NOVAULT}" == "1" ] | ||
then | ||
echo -e "Skipping secret setup" | ||
|
@@ -42,9 +38,9 @@ export HZN_AGBOT_URL=${AGBOT_SAPI_URL} | |
|
||
# Create secrets in userdev org | ||
echo -e "Create netspeed secret1" | ||
CMD="hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE1} ${CREATE_ORG_SECRET1}" | ||
CMD="hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE1} ${CREATE_ORG_SECRET1} -O" | ||
echo "$CMD" | ||
RES=$(hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE1} ${CREATE_ORG_SECRET1}) | ||
RES=$(hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE1} ${CREATE_ORG_SECRET1} -O) | ||
|
||
# check for erroneous return | ||
if [ $? -ne 0 ]; then | ||
|
@@ -55,9 +51,9 @@ fi | |
echo "$RES" | ||
|
||
echo -e "Create netspeed secret2" | ||
CMD="hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET2}" | ||
CMD="hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET2} -O" | ||
echo "$CMD" | ||
RES=$(hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET2}) | ||
RES=$(hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET2} -O) | ||
|
||
# check for erroneous return | ||
if [ $? -ne 0 ]; then | ||
|
@@ -68,15 +64,15 @@ fi | |
echo "$RES" | ||
|
||
echo -e "Create netspeed secret3" | ||
CMD="hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET3}" | ||
CMD="hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET3} -O" | ||
echo "$CMD" | ||
RES=$(hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET3}) | ||
RES=$(hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET3} -O) | ||
|
||
# creating secrets for compcheck tests | ||
echo -e "Create org secret sqltoken" | ||
CMD="hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey sqltoken -d mysqltoken ${CREATE_ORG_SECRET4}" | ||
CMD="hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey sqltoken -d mysqltoken ${CREATE_ORG_SECRET4} -O" | ||
echo "$CMD" | ||
RES=$(hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey sqltoken -d mysqltoken ${CREATE_ORG_SECRET4}) | ||
RES=$(hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey sqltoken -d mysqltoken ${CREATE_ORG_SECRET4} -O) | ||
|
||
# check for erroneous return | ||
if [ $? -ne 0 ]; then | ||
|
@@ -92,14 +88,14 @@ E2EDEV_ORG="[email protected]" | |
E2EDEV_ADMIN_AUTH="[email protected]/e2edevadmin:e2edevadminpw" | ||
|
||
echo -e "Create netspeed secret1" | ||
CMD="hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE1} ${CREATE_ORG_SECRET1}" | ||
CMD="hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE1} ${CREATE_ORG_SECRET1} -O" | ||
echo "$CMD" | ||
RES=$(hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE1} ${CREATE_ORG_SECRET1}) | ||
RES=$(hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE1} ${CREATE_ORG_SECRET1} -O) | ||
|
||
echo -e "Create user secret aitoken" | ||
CMD="hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey aitoken -d myaitoken ${CREATE_USER_SECRET5}" | ||
CMD="hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey aitoken -d myaitoken ${CREATE_USER_SECRET5} -O" | ||
echo "$CMD" | ||
RES=$(hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey aitoken -d myaitoken ${CREATE_USER_SECRET5}) | ||
RES=$(hzn secretsmanager secret add -o ${USERDEV_ORG} -u ${USERDEV_ADMIN_AUTH} --secretKey aitoken -d myaitoken ${CREATE_USER_SECRET5} -O) | ||
|
||
# check for erroneous return | ||
if [ $? -ne 0 ]; then | ||
|
@@ -110,9 +106,9 @@ fi | |
echo "$RES" | ||
|
||
echo -e "Create netspeed secret2" | ||
CMD="hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET2}" | ||
CMD="hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET2} -O" | ||
echo "$CMD" | ||
RES=$(hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET2}) | ||
RES=$(hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET2} -O) | ||
|
||
# check for erroneous return | ||
if [ $? -ne 0 ]; then | ||
|
@@ -123,9 +119,9 @@ fi | |
echo "$RES" | ||
|
||
echo -e "Create netspeed secret3" | ||
CMD="hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET3}" | ||
CMD="hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET3} -O" | ||
echo "$CMD" | ||
RES=$(hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET3}) | ||
RES=$(hzn secretsmanager secret add -o ${E2EDEV_ORG} -u ${E2EDEV_ADMIN_AUTH} --secretKey ${ORG_SECRET_KEY} -d ${ORG_SECRET_VALUE2} ${CREATE_ORG_SECRET3} -O) | ||
|
||
# check for erroneous return | ||
if [ $? -ne 0 ]; then | ||
|