blob: 392a84aa1f382618f43d413a767797f5983772d0 [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' \
DR695H3cef7882019-10-11 10:54:08 -040026'robotframework-archivelibrary==0.4.0'
27
28pip 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" \
DR695Hb0e92672019-10-07 10:41:33 -040034'robotframework-onap==0.6.0.*'
DR695Hccff30b2017-02-17 18:44:24 -050035
DR695Hfacbc292019-08-07 11:15:46 -040036# i dont why we need this, but lets protobuf work in docker
37touch /var/opt/ONAP/robot/library/google/__init__.py
DR695Hccff30b2017-02-17 18:44:24 -050038
jf98600d5b0bf2017-02-24 14:39:40 -050039if [ -d $path/testsuite/heatbridge ]
DR695Hccff30b2017-02-17 18:44:24 -050040then
jf98600d5b0bf2017-02-24 14:39:40 -050041 # Support LF build location
42 cd $path/testsuite/heatbridge
43else
DR695Hccff30b2017-02-17 18:44:24 -050044 cd ~
45 git config --global http.sslVerify false
46 if [ -d ~/heatbridge ]
47 then
48 cd heatbridge
49 git pull origin master
jf98600d5b0bf2017-02-24 14:39:40 -050050 else
Jerry Flooddb798792017-03-29 11:25:30 -040051 git clone https://gerrit.onap.org/r/testsuite/heatbridge.git
DR695Hccff30b2017-02-17 18:44:24 -050052 cd heatbridge
53 fi
54fi
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010055
56pip install \
57--no-cache-dir \
58--upgrade \
59--exists-action s \
60--target="$path/robot/library" \
61./heatbridge
DR695Hccff30b2017-02-17 18:44:24 -050062
DR695H51fcd0e2019-10-04 14:14:32 -040063sed -i 's/cinderclient\.v1\.client/cinderclient\.v2\.client/g' /var/opt/ONAP/robot/library/heatbridge/OpenstackManager.py
64
Dina Dodinfabd1e82017-08-01 10:53:04 +030065# Go back to execution folder
66cd $path
67
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010068# if the script is running during the image build skip the rest of it
69# as required software is installed already.
70if $BUILDTIME
DR695Hccff30b2017-02-17 18:44:24 -050071then
Dmitry Puzikovb0e12b42019-03-04 11:06:16 +010072 # 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
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010076 echo "Skipping desktop steps, building container image..."
77else
78 #
79 # Get the appropriate chromedriver. Default to linux64
80 #
DR695Hfacbc292019-08-07 11:15:46 -040081 CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/75.0.3770.140
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010082 CHROMEDRIVER_ZIP=chromedriver_linux64.zip
83 CHROMEDRIVER_TARGET=chromedriver.zip
marekpl503647c2018-10-24 14:33:25 +020084
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010085 # 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
DR695H9d810d02019-06-18 17:16:25 -0400106fi