shipyard/tools/set_env
Anthony Lin b8bb66d412 Update Scripts
We will no longer need to manually update the '/etc/hosts' file
for 'in-cluster' scenario with the bug fix in [0]. This patch set
is meant to update the scripts in the tools directory to reflect
that change.

Note that user will still need to ensure that the DNS is set up or
'/etc/hosts' file is properly updated if he/she is executing the
workflow from outside the cluster, e.g. via jump server

[0] https://review.gerrithub.io/#/c/398739/

Change-Id: I0580cfc473b0f1b0ed824a578d3e6c89dd6f1443
2018-02-09 15:48:30 +00:00

41 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# NOTE: If user is executing deploy_site, update_site or redeploy_server
# workflow from outside the cluster, e.g. from a remote jump server, then
# he/she will need to ensure that the DNS server is able to resolve the
# FQDN of the Shipyard and Keystone public URL (both will be pointing to
# the IP of the Ingress Controller). If the DNS resolution is not available,
# the user will need to ensure that the /etc/hosts file is properly updated
# before setting up the environment variables and running the worflow.
# Define Variable
namespace="${namespace:-ucp}"
# Export Environment Variables
# Note that 'shipyard_query_time' has a default value of 90 seconds
# Note that 'max_shipyard_count' has a default value of 60 loops (based on
# 90 seconds back off per cycle, i.e. 60 * 90 = 5400 seconds = 1.5 hr)
# Note that user can use a different value for each of the variables by
# exporting the required environment variable prior to running the script
export max_shipyard_count=${max_shipyard_count:-60}
export shipyard_query_time=${shipyard_query_time:-90}
export OS_AUTH_URL="${OS_AUTH_URL:-http://keystone.${namespace}.svc.cluster.local:80/v3}"
export OS_PASSWORD="${OS_PASSWORD:-password}"
export OS_PROJECT_DOMAIN_NAME="${OS_PROJECT_DOMAIN_NAME:-default}"
export OS_PROJECT_NAME="${OS_PROJECT_NAME:-service}"
export OS_USERNAME="${OS_USERNAME:-shipyard}"
export OS_USER_DOMAIN_NAME="${OS_USER_DOMAIN_NAME:-default}"