Remove some tags for projects NOGO in Frankfurt
[testsuite.git] / setup.sh
1 #!/bin/bash
2 #
3 # setup : script to setup required runtime environment. This script can be run again to update anything
4 # this should stay in your project directory
5
6
7 # save console output in setup_<timestamp>.log file in project directory
8 timestamp=$(date +"%m%d%Y_%H%M%S")
9 LOG_FILE=setup_$timestamp.log
10 exec > >(tee -a ${LOG_FILE} )
11 exec 2> >(tee -a ${LOG_FILE} >&2)
12
13
14 # get the path
15 path=$(pwd)
16 pip install \
17 --no-cache-dir \
18 --exists-action s \
19 --target="$path/robot/library" \
20 'robotframework-seleniumlibrary==3.3.1' \
21 'robotframework-databaselibrary==1.2' \
22 'robotframework-angularjs==0.0.9' \
23 'robotframework-requests==0.5.0' \
24 'robotframework-sshlibrary==3.3.0' \
25 'robotframework-ftplibrary==1.6' \
26 'robotframework-archivelibrary==0.4.0'
27
28 pip install \
29 --pre \
30 --no-cache-dir \
31 --exists-action s \
32 --target="$path/robot/library" \
33 --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" \
34 'robotframework-onap==0.6.0.*'
35
36 # i dont why we need this, but lets protobuf work in docker
37 touch /var/opt/ONAP/robot/library/google/__init__.py
38
39 if [ -d $path/testsuite/heatbridge ]
40 then
41     # Support LF build location
42         cd $path/testsuite/heatbridge
43 else
44         cd ~
45         git config --global http.sslVerify false
46         if [ -d ~/heatbridge ]
47         then
48                 cd heatbridge
49                 git pull origin master
50         else
51                 git clone https://gerrit.onap.org/r/testsuite/heatbridge.git
52                 cd heatbridge
53         fi
54 fi
55
56 pip install \
57 --no-cache-dir \
58 --upgrade \
59 --exists-action s \
60 --target="$path/robot/library" \
61 ./heatbridge
62
63 sed -i 's/cinderclient\.v1\.client/cinderclient\.v2\.client/g' /var/opt/ONAP/robot/library/heatbridge/OpenstackManager.py
64
65 # Go back to execution folder
66 cd $path
67
68 # if the script is running during the image build skip the rest of it
69 # as required software is installed already.
70 if $BUILDTIME
71 then
72         # we need to update PATH with chromium-chromedriver
73         echo "Adding in-container chromedriver to PATH"
74         ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver
75         
76         echo "Skipping desktop steps, building container image..."
77 else    
78         #
79         # Get the appropriate chromedriver. Default to linux64
80         #
81         CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/75.0.3770.140
82         CHROMEDRIVER_ZIP=chromedriver_linux64.zip
83         CHROMEDRIVER_TARGET=chromedriver.zip
84
85         # Handle mac and windows
86         OS=`uname -s`
87         case $OS in
88           MINGW*_NT*)
89                 CHROMEDRIVER_ZIP=chromedriver_win32.zip
90                 ;;
91           Darwin*)
92                 CHROMEDRIVER_ZIP=chromedriver_mac64.zip
93                 ;;
94           *) echo "Defaulting to Linux 64" ;;
95         esac
96
97         if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ]
98         then
99             curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
100                 unzip chromedriver.zip -d /usr/local/bin
101         else
102             curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
103                 unzip $CHROMEDRIVER_TARGET
104         fi
105         rm -rf $CHROMEDRIVER_TARGET
106 fi