remove one last sdc warning
[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 --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" \
21 'robotframework-seleniumlibrary==3.3.1' \
22 'robotframework-databaselibrary==1.2' \
23 'robotframework-angularjs==0.0.9' \
24 'robotframework-requests==0.5.0' \
25 'robotframework-sshlibrary==3.3.0' \
26 'robotframework-ftplibrary==1.6' \
27 'robotframework-archivelibrary==0.4.0' \
28 'robotframework-onap==0.5'
29
30 # i dont why we need this, but lets protobuf work in docker
31 touch /var/opt/ONAP/robot/library/google/__init__.py
32
33 if [ -d $path/testsuite/heatbridge ]
34 then
35     # Support LF build location
36         cd $path/testsuite/heatbridge
37 else
38         cd ~
39         git config --global http.sslVerify false
40         if [ -d ~/heatbridge ]
41         then
42                 cd heatbridge
43                 git pull origin master
44         else
45                 git clone https://gerrit.onap.org/r/testsuite/heatbridge.git
46                 cd heatbridge
47         fi
48 fi
49
50 pip install \
51 --no-cache-dir \
52 --upgrade \
53 --exists-action s \
54 --target="$path/robot/library" \
55 ./heatbridge
56
57 # Go back to execution folder
58 cd $path
59
60 # if the script is running during the image build skip the rest of it
61 # as required software is installed already.
62 if $BUILDTIME
63 then
64         # we need to update PATH with chromium-chromedriver
65         echo "Adding in-container chromedriver to PATH"
66         ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver
67         
68         echo "Skipping desktop steps, building container image..."
69 else    
70         #
71         # Get the appropriate chromedriver. Default to linux64
72         #
73         CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/75.0.3770.140
74         CHROMEDRIVER_ZIP=chromedriver_linux64.zip
75         CHROMEDRIVER_TARGET=chromedriver.zip
76
77         # Handle mac and windows
78         OS=`uname -s`
79         case $OS in
80           MINGW*_NT*)
81                 CHROMEDRIVER_ZIP=chromedriver_win32.zip
82                 ;;
83           Darwin*)
84                 CHROMEDRIVER_ZIP=chromedriver_mac64.zip
85                 ;;
86           *) echo "Defaulting to Linux 64" ;;
87         esac
88
89         if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ]
90         then
91             curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
92                 unzip chromedriver.zip -d /usr/local/bin
93         else
94             curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
95                 unzip $CHROMEDRIVER_TARGET
96         fi
97         rm -rf $CHROMEDRIVER_TARGET
98 fi