537512b12419b84e05a853cfcf4d35522808c7f7
[yaml_builds.git] / tools / update_software.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2019 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 set -x
19 TIMESTAMP=$(date +"%Y%m%d%H%M")
20 LOGFILE=/var/log/update_software_$TIMESTAMP.log
21 echo "logging to $LOGFILE"
22 exec 1> >(tee -a $LOGFILE)
23 exec 2>&1
24
25 # Site specific variables
26 export OS_AUTH_URL=
27 export OS_USERNAME=shipyard
28 export OS_PASSWORD=
29 REGION_NAME=
30
31 tools/airship shipyard create configdocs ${REGION_NAME} --directory=/target/configs/promenade
32
33 tools/airship shipyard commit configdocs
34
35 SHIPYARD_ACTION=$(tools/airship shipyard create action update_software | awk '/update_software/ {print $2};')
36
37 tools/airship shipyard get actions
38
39 # Monitor the workflow
40 tools/airship shipyard describe $SHIPYARD_ACTION
41