summaryrefslogtreecommitdiffstats
path: root/tools/keystone/endpoint.sh
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-01-26 15:29:13 +0100
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-01-27 11:30:58 +0100
commit9f9356251d1e5d1812ac16859f8b6b6f20eeb8dd (patch)
treef8ba380db5a3363db8c350b6a9d40fd533d384c4 /tools/keystone/endpoint.sh
parente7fe8818ece870b88556f7bad78b589b26d19151 (diff)
Fixes for Multisite Kingbird Jenkins jobs
This patch contains the changes needed to get scripts working as part of Jenkins jobs. Changes include fixes for below issues. - Archive servicepass.ini and endpoints.ini under $WORKSPACE due to inability of Jenkins with archiving artifacts that are stored in directories which has no read permissions for. - Fetch servicepass.ini and endpoints.ini from corresponding locations and store them in $WORKSPACE. Change-Id: I88d477f5c6217a6ad7db250ae582fab2a17dc30e Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'tools/keystone/endpoint.sh')
-rwxr-xr-xtools/keystone/endpoint.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/keystone/endpoint.sh b/tools/keystone/endpoint.sh
index 410a723..b79638f 100755
--- a/tools/keystone/endpoint.sh
+++ b/tools/keystone/endpoint.sh
@@ -16,12 +16,16 @@ set -o pipefail
# Ensure that openrc containing OpenStack environment variables is present.
source openrc
+# if running as part of Jenkins job, create the file in WORKSPACE
+WORKSPACE=${WORKSPACE:-/root}
+ENDPOINT_FILE="${WORKSPACE}/endpoints.ini"
+
# Endpoints. Dynamically get IP addresses from another service (keystone)
ENDPOINT_PUBLIC_URL=$(openstack endpoint list | grep keystone | grep public | cut -d '|' -f 8 | cut -d '/' -f 3 | cut -d ':' -f 1)
ENDPOINT_ADMIN_URL=$(openstack endpoint list | grep keystone | grep admin | cut -d '|' -f 8 | cut -d '/' -f 3 | cut -d ':' -f 1)
ENDPOINT_INTERNAL_URL=$(openstack endpoint list | grep keystone | grep internal | cut -d '|' -f 8 | cut -d '/' -f 3 | cut -d ':' -f 1)
-cat <<EOT >> /root/endpoints.ini
+cat <<EOT >> ${ENDPOINT_FILE}
[DEFAULT]
public_url=${ENDPOINT_PUBLIC_URL}
admin_url=${ENDPOINT_ADMIN_URL}