2 ##############################################################################
3 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. #
5 # Licensed under the Apache License, Version 2.0 (the "License"); you may #
6 # not use this file except in compliance with the License. #
8 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ##############################################################################
20 TIMESTAMP=$(date +"%Y%m%d%H%M")
21 LOGFILE=/var/log/deploy_site_$TIMESTAMP.log
22 echo "logging to $LOGFILE"
23 exec 1> >(tee -a $LOGFILE)
26 # Regional Server specific variables
29 # Site specific variables
36 ## clean site YAMLs from Deckhand
37 TOKEN=`sudo docker run --rm --net=host -e OS_AUTH_URL=http://keystone-api.ucp.svc.cluster.local:80/v3 -e OS_PROJECT_DOMAIN_NAME=default -e OS_USER_DOMAIN_NAME=default -e OS_PROJECT_NAME=service -e OS_REGION_NAME=RegionOne -e OS_USERNAME=drydock -e OS_PASSWORD=${DRYDOCK_PASSWORD} -e OS_IDENTITY_API_VERSION=3 ${KEYSTONE_IMAGE} openstack token issue -f value -c id`
39 curl -v -X DELETE -H "X-AUTH-TOKEN: $TOKEN" -H 'Content-Type: application/x-yaml' http://deckhand-int.ucp.svc.cluster.local:9000/api/v1.0/revisions
43 sudo docker run -v $(pwd):/target -e 'OS_AUTH_URL=http://keystone-api.ucp.svc.cluster.local:80/v3' -e OS_PASSWORD=${SHIPYARD_PASSWORD} -e 'OS_PROJECT_DOMAIN_NAME=default' -e 'OS_PROJECT_NAME=service' -e 'OS_USERNAME=shipyard' -e 'OS_USER_DOMAIN_NAME=default' -e 'OS_IDENTITY_API_VERSION=3' --rm --net=host ${SHIPYARD_IMAGE} create configdocs ${REGION_NAME} --directory=/target/configs/promenade
49 sudo docker run -v $(pwd):/target -e 'OS_AUTH_URL=http://keystone-api.ucp.svc.cluster.local:80/v3' -e OS_PASSWORD=${SHIPYARD_PASSWORD} -e 'OS_PROJECT_DOMAIN_NAME=default' -e 'OS_PROJECT_NAME=service' -e 'OS_USERNAME=shipyard' -e 'OS_USER_DOMAIN_NAME=default' -e 'OS_IDENTITY_API_VERSION=3' --rm --net=host ${SHIPYARD_IMAGE} get renderedconfigdocs --committed > /tmp/renderedconfigdocs.yaml
55 sudo docker run -v $(pwd):/target -e 'OS_AUTH_URL=http://keystone-api.ucp.svc.cluster.local:80/v3' -e OS_PASSWORD=${SHIPYARD_PASSWORD} -e 'OS_PROJECT_DOMAIN_NAME=default' -e 'OS_PROJECT_NAME=service' -e 'OS_USERNAME=shipyard' -e 'OS_USER_DOMAIN_NAME=default' -e 'OS_IDENTITY_API_VERSION=3' --rm --net=host ${SHIPYARD_IMAGE} commit configdocs
61 sudo docker run -e 'OS_AUTH_URL=http://keystone-api.ucp.svc.cluster.local:80/v3' -e OS_PASSWORD=${SHIPYARD_PASSWORD} -e 'OS_PROJECT_DOMAIN_NAME=default' -e 'OS_PROJECT_NAME=service' -e 'OS_USERNAME=shipyard' -e 'OS_USER_DOMAIN_NAME=default' -e 'OS_IDENTITY_API_VERSION=3' --rm --net=host ${SHIPYARD_IMAGE} create action deploy_site
65 sudo docker run -e 'OS_AUTH_URL=http://keystone-api.ucp.svc.cluster.local:80/v3' -e OS_PASSWORD=${SHIPYARD_PASSWORD} -e 'OS_PROJECT_DOMAIN_NAME=default' -e 'OS_PROJECT_NAME=service' -e 'OS_USERNAME=shipyard' -e 'OS_USER_DOMAIN_NAME=default' -e 'OS_IDENTITY_API_VERSION=3' --rm --net=host ${SHIPYARD_IMAGE} create action update_site
70 sudo docker run -v $(pwd):/target -e 'OS_AUTH_URL=http://keystone-api.ucp.svc.cluster.local:80/v3' -e OS_PASSWORD=${SHIPYARD_PASSWORD} -e 'OS_PROJECT_DOMAIN_NAME=default' -e 'OS_PROJECT_NAME=service' -e 'OS_USERNAME=shipyard' -e 'OS_USER_DOMAIN_NAME=default' -e 'OS_IDENTITY_API_VERSION=3' --rm --net=host ${SHIPYARD_IMAGE} get actions
85 echo "## Airship deployment has been started..."
87 echo "## To monitor progress check:"
88 echo "## MaaS GUI -> http://{{yaml.genesis.host}}:30001/MAAS/#/nodes"
89 echo "## Airflow GUI -> http://{{yaml.genesis.host}}:30004/admin/taskinstance/"