Release image version 1.12.2
[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 'robotframework-jsonlibrary==0.3.1'
28
29 # i dont why we need this, but lets protobuf work in docker
30 touch /var/opt/ONAP/robot/library/google/__init__.py
31
32 # Go back to execution folder
33 cd $path
34
35 # if the script is running during the image build skip the rest of it
36 # as required software is installed already.
37 if $BUILDTIME
38 then
39         # we need to update PATH with chromium-chromedriver
40         echo "Adding in-container chromedriver to PATH"
41         ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver
42
43         echo "Skipping desktop steps, building container image..."
44 else
45         #
46         # Get the appropriate chromedriver. Default to linux64
47         #
48         CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/75.0.3770.140
49         CHROMEDRIVER_ZIP=chromedriver_linux64.zip
50         CHROMEDRIVER_TARGET=chromedriver.zip
51
52         # Handle mac and windows
53         OS=`uname -s`
54         case $OS in
55           MINGW*_NT*)
56                 CHROMEDRIVER_ZIP=chromedriver_win32.zip
57                 ;;
58           Darwin*)
59                 CHROMEDRIVER_ZIP=chromedriver_mac64.zip
60                 ;;
61           *) echo "Defaulting to Linux 64" ;;
62         esac
63
64         if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ]
65         then
66             curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
67                 unzip chromedriver.zip -d /usr/local/bin
68         else
69             curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
70                 unzip $CHROMEDRIVER_TARGET
71         fi
72         rm -rf $CHROMEDRIVER_TARGET
73 fi