b60416511f15310f3daa3cf56c23893c54547e9c
[yaml_builds.git] / tools / deploy_site.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.        #
4 #                                                                            #
5 # Licensed under the Apache License, Version 2.0 (the "License"); you may    #
6 # not use this file except in compliance with the License.                   #
7 #                                                                            #
8 # You may obtain a copy of the License at                                    #
9 #       http://www.apache.org/licenses/LICENSE-2.0                           #
10 #                                                                            #
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 ##############################################################################
17
18
19 set -x
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)
24 exec 2>&1
25
26 # Site specific variables
27 export OS_AUTH_URL=
28 export OS_USERNAME=shipyard
29 export OS_PASSWORD=
30 REGION_NAME=
31
32 sleep 900
33
34 tools/airship shipyard create configdocs ${REGION_NAME} --directory=/target/configs/promenade
35
36 tools/airship shipyard commit configdocs
37
38 tools/airship shipyard create action deploy_site
39
40 tools/airship shipyard get actions
41
42 SHIPYARD_ACTION=$(tools/airship shipyard get actions | awk '/deploy_site/ {print $2};')
43
44 tools/airship shipyard describe $SHIPYARD_ACTION
45
46 echo "## Airship deployment has been started..."
47 echo "##"
48 echo "## To monitor progress check:"
49 echo "## MaaS GUI    -> http://{{yaml.genesis.host}}:30001/MAAS/#/nodes"
50 echo "## Airflow GUI -> http://{{yaml.genesis.host}}:30004/admin/taskinstance/"
51
52 exec 2>&-
53 exec 1>&-
54 exit 0
55