summaryrefslogtreecommitdiffstats
path: root/tools/files/shipyard.sh
diff options
context:
space:
mode:
authorJames Gu <james.gu@att.com>2020-05-04 13:57:29 -0700
committerJames Gu <james.gu@att.com>2020-10-05 21:25:18 +0000
commitda4f1540dec64779c01f7d0258b1a748ace9b131 (patch)
tree47856f75607849dc848dadcbcb1a7d048f91f7f7 /tools/files/shipyard.sh
parent05686a28172cd3e79c71987cf495e0e67e064eb1 (diff)
Treasuremap 1.8 integration
Upgrade pod 17 to Treasuremap 1.8 prime for CNTT RI-1. Added deploy script enhancement to include pregenesis, certs, and wrapper for shipyard cli command. Added clean-genesis script to properly clean genesis node for redeployment. Signed-off-by: James Gu <james.gu@att.com> Change-Id: I4c150ef216d5eb631a0980c72b3c6c80a55788d0 Signed-off-by: James Gu <james.gu@att.com>
Diffstat (limited to 'tools/files/shipyard.sh')
-rwxr-xr-xtools/files/shipyard.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/files/shipyard.sh b/tools/files/shipyard.sh
new file mode 100755
index 0000000..a6d5832
--- /dev/null
+++ b/tools/files/shipyard.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+#Checks shipyard action status
+
+set -e
+CONTAINER="shipyard-api"
+TEMP_RESULT=${TEMP_RESULT:-$(mktemp)}
+API=$(kubectl get pods -n ucp -l application=shipyard,component=api --no-headers | awk '{print $1}' | head -n 1)
+# this doesn't actually get exported to environment unless the script is sourced
+export OS_PASSWORD=$(kubectl exec -it ${API} -n ucp -c ${CONTAINER} -- cat /etc/shipyard/shipyard.conf | grep "password =" | awk '{print $3}' | tr -d '\r')
+OS_AUTH_URL=$(kubectl exec -it ${API} -n ucp -c ${CONTAINER} -- cat /etc/shipyard/shipyard.conf |grep "auth_uri =" | awk '{print $3}' | tr -d '\r')
+SHIPYARD_IMAGE=$(kubectl get po ${API} -n ucp -o jsonpath="{.spec.containers[0].image}")
+SHIPYARD_HOSTPATH="/target"
+SHIPYARD_IMAGE="${SHIPYARD_IMAGE}"
+LIST_STEPS=$(mktemp)
+
+# Define Base Docker Command
+base_docker_command=$(cat << EndOfCommand
+sudo -E docker run -t --rm --net=host
+-e no_proxy=${NO_PROXY:-127.0.0.1,localhost,.svc.cluster.local}
+-e OS_AUTH_URL=${OS_AUTH_URL}
+-e OS_USERNAME=${OS_USERNAME:-shipyard}
+-e OS_USER_DOMAIN_NAME=${OS_DOMAIN:-default}
+-e OS_PASSWORD
+-e OS_PROJECT_DOMAIN_NAME=${OS_PROJECT_DOMAIN_NAME:-default}
+-e OS_PROJECT_NAME=${OS_PROJECT_NAME:-service}
+EndOfCommand
+)
+
+echo "$OS_AUTH_URL"
+
+# Execute Shipyard CLI
+
+ ${base_docker_command} -v "$(pwd)":"${SHIPYARD_HOSTPATH}" "${SHIPYARD_IMAGE}" "${@}"