blob: 2e18a768184e12cc56645c725858f094d17639a3 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001#!/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
Dina Dodinfabd1e82017-08-01 10:53:04 +03005
6
7# save console output in setup_<timestamp>.log file in project directory
8timestamp=$(date +"%m%d%Y_%H%M%S")
9LOG_FILE=setup_$timestamp.log
10exec > >(tee -a ${LOG_FILE} )
11exec 2> >(tee -a ${LOG_FILE} >&2)
12
DR695Hccff30b2017-02-17 18:44:24 -050013
14# get the path
15path=$(pwd)
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010016pip install \
17--no-cache-dir \
18--exists-action s \
19--target="$path/robot/library" \
DR695H910097e2019-05-08 13:55:32 -040020'robotframework-seleniumlibrary==3.3.1' \
DR695H345c9922019-05-10 15:52:12 -040021'robotframework-databaselibrary==1.2' \
DR695H910097e2019-05-08 13:55:32 -040022'robotframework-angularjs==0.0.9' \
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010023'robotframework-requests==0.5.0' \
DR695H910097e2019-05-08 13:55:32 -040024'robotframework-sshlibrary==3.3.0' \
DR695H345c9922019-05-10 15:52:12 -040025'robotframework-ftplibrary==1.6' \
rajendrajaiswal9b723a82019-11-25 12:18:51 +000026'robotframework-archivelibrary==0.4.0' \
27'robotframework-jsonlibrary==0.3.1'
DR695H3cef7882019-10-11 10:54:08 -040028
29pip install \
30--pre \
31--no-cache-dir \
32--exists-action s \
Krzysztof Kuzmicki0b9c2662022-05-06 16:31:31 +020033--force-reinstall \
34--upgrade \
DR695H3cef7882019-10-11 10:54:08 -040035--target="$path/robot/library" \
Krzysztof Kuzmicki0b9c2662022-05-06 16:31:31 +020036git+https://git.onap.org/testsuite/python-testing-utils.git@master#egg=robotframework-onap\&subdirectory=robotframework-onap
37
DR695Hccff30b2017-02-17 18:44:24 -050038
DR695Hfacbc292019-08-07 11:15:46 -040039# i dont why we need this, but lets protobuf work in docker
40touch /var/opt/ONAP/robot/library/google/__init__.py
DR695Hccff30b2017-02-17 18:44:24 -050041
Brian Freemand2aa3522020-11-24 09:41:38 -050042###############################
43# remove heatbridge
44# commented out for testing
45################################################################
46#if [ -d $path/testsuite/heatbridge ]
47#then
48# # Support LF build location
49# cd $path/testsuite/heatbridge
50#else
51# cd ~
52# git config --global http.sslVerify false
53# if [ -d ~/heatbridge ]
54# then
55# cd heatbridge
56# git pull origin master
57# else
58# git clone https://gerrit.onap.org/r/testsuite/heatbridge.git
59# cd heatbridge
60# fi
61#fi
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010062
Brian Freemand2aa3522020-11-24 09:41:38 -050063#pip install \
64#--no-cache-dir \
65#--upgrade \
66#--exists-action s \
67#--target="$path/robot/library" \
68#./heatbridge
DR695Hccff30b2017-02-17 18:44:24 -050069
Brian Freemand2aa3522020-11-24 09:41:38 -050070#sed -i 's/cinderclient\.v1\.client/cinderclient\.v2\.client/g' /var/opt/ONAP/robot/library/heatbridge/OpenstackManager.py
71
72################################################################
DR695H51fcd0e2019-10-04 14:14:32 -040073
Dina Dodinfabd1e82017-08-01 10:53:04 +030074# Go back to execution folder
75cd $path
76
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010077# if the script is running during the image build skip the rest of it
78# as required software is installed already.
79if $BUILDTIME
DR695Hccff30b2017-02-17 18:44:24 -050080then
Dmitry Puzikovb0e12b42019-03-04 11:06:16 +010081 # we need to update PATH with chromium-chromedriver
82 echo "Adding in-container chromedriver to PATH"
83 ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver
rajendrajaiswal9b723a82019-11-25 12:18:51 +000084
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010085 echo "Skipping desktop steps, building container image..."
rajendrajaiswal9b723a82019-11-25 12:18:51 +000086else
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010087 #
88 # Get the appropriate chromedriver. Default to linux64
89 #
DR695Hfacbc292019-08-07 11:15:46 -040090 CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/75.0.3770.140
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010091 CHROMEDRIVER_ZIP=chromedriver_linux64.zip
92 CHROMEDRIVER_TARGET=chromedriver.zip
marekpl503647c2018-10-24 14:33:25 +020093
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010094 # Handle mac and windows
95 OS=`uname -s`
96 case $OS in
97 MINGW*_NT*)
98 CHROMEDRIVER_ZIP=chromedriver_win32.zip
99 ;;
100 Darwin*)
101 CHROMEDRIVER_ZIP=chromedriver_mac64.zip
102 ;;
103 *) echo "Defaulting to Linux 64" ;;
104 esac
105
106 if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ]
107 then
108 curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
109 unzip chromedriver.zip -d /usr/local/bin
110 else
111 curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
112 unzip $CHROMEDRIVER_TARGET
113 fi
114 rm -rf $CHROMEDRIVER_TARGET
Brian Freemand2aa3522020-11-24 09:41:38 -0500115fi