blob: 3ed762a31cb00806f11a45a658487f584d1f810c [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" \
DR695H345c9922019-05-10 15:52:12 -040020--extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" \
DR695H910097e2019-05-08 13:55:32 -040021'robotframework-seleniumlibrary==3.3.1' \
DR695H345c9922019-05-10 15:52:12 -040022'robotframework-databaselibrary==1.2' \
DR695H910097e2019-05-08 13:55:32 -040023'robotframework-angularjs==0.0.9' \
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010024'robotframework-requests==0.5.0' \
DR695H910097e2019-05-08 13:55:32 -040025'robotframework-sshlibrary==3.3.0' \
DR695H345c9922019-05-10 15:52:12 -040026'robotframework-ftplibrary==1.6' \
DR695H27426332019-05-21 11:26:28 -040027'robotframework-pykafka==0.10' \
DR695H345c9922019-05-10 15:52:12 -040028'robotframework-archivelibrary==0.4.0' \
DR695H27426332019-05-21 11:26:28 -040029'robotframework-onap==0.5'
DR695Hccff30b2017-02-17 18:44:24 -050030
31
jf98600d5b0bf2017-02-24 14:39:40 -050032if [ -d $path/testsuite/heatbridge ]
DR695Hccff30b2017-02-17 18:44:24 -050033then
jf98600d5b0bf2017-02-24 14:39:40 -050034 # Support LF build location
35 cd $path/testsuite/heatbridge
36else
DR695Hccff30b2017-02-17 18:44:24 -050037 cd ~
38 git config --global http.sslVerify false
39 if [ -d ~/heatbridge ]
40 then
41 cd heatbridge
42 git pull origin master
jf98600d5b0bf2017-02-24 14:39:40 -050043 else
Jerry Flooddb798792017-03-29 11:25:30 -040044 git clone https://gerrit.onap.org/r/testsuite/heatbridge.git
DR695Hccff30b2017-02-17 18:44:24 -050045 cd heatbridge
46 fi
47fi
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010048
49pip install \
50--no-cache-dir \
51--upgrade \
52--exists-action s \
53--target="$path/robot/library" \
54./heatbridge
DR695Hccff30b2017-02-17 18:44:24 -050055
Dina Dodinfabd1e82017-08-01 10:53:04 +030056# Go back to execution folder
57cd $path
58
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010059# if the script is running during the image build skip the rest of it
60# as required software is installed already.
61if $BUILDTIME
DR695Hccff30b2017-02-17 18:44:24 -050062then
Dmitry Puzikovb0e12b42019-03-04 11:06:16 +010063 # we need to update PATH with chromium-chromedriver
64 echo "Adding in-container chromedriver to PATH"
65 ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver
66
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010067 echo "Skipping desktop steps, building container image..."
68else
69 #
70 # Get the appropriate chromedriver. Default to linux64
71 #
72 CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/2.43
73 CHROMEDRIVER_ZIP=chromedriver_linux64.zip
74 CHROMEDRIVER_TARGET=chromedriver.zip
marekpl503647c2018-10-24 14:33:25 +020075
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010076 # Handle mac and windows
77 OS=`uname -s`
78 case $OS in
79 MINGW*_NT*)
80 CHROMEDRIVER_ZIP=chromedriver_win32.zip
81 ;;
82 Darwin*)
83 CHROMEDRIVER_ZIP=chromedriver_mac64.zip
84 ;;
85 *) echo "Defaulting to Linux 64" ;;
86 esac
87
88 if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ]
89 then
90 curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
91 unzip chromedriver.zip -d /usr/local/bin
92 else
93 curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
94 unzip $CHROMEDRIVER_TARGET
95 fi
96 rm -rf $CHROMEDRIVER_TARGET
DR695H0ca56d12019-05-14 11:48:20 -040097fi
98
99#
100# Install kafkacat : https://github.com/edenhill/kafkacat
101#
102OS=`uname -s`
103case $OS in
104 Darwin)
105 brew install kafkacat ;;
106 Linux)
107 apt-get -y install kafkacat
108esac