blob: 2e86d0377cd26640a0b784b0d42356b685ef1637 [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' \
DR695H345c9922019-05-10 15:52:12 -040027'robotframework-archivelibrary==0.4.0' \
DR695H27426332019-05-21 11:26:28 -040028'robotframework-onap==0.5'
DR695Hccff30b2017-02-17 18:44:24 -050029
DR695Hfacbc292019-08-07 11:15:46 -040030# i dont why we need this, but lets protobuf work in docker
31touch /var/opt/ONAP/robot/library/google/__init__.py
DR695Hccff30b2017-02-17 18:44:24 -050032
jf98600d5b0bf2017-02-24 14:39:40 -050033if [ -d $path/testsuite/heatbridge ]
DR695Hccff30b2017-02-17 18:44:24 -050034then
jf98600d5b0bf2017-02-24 14:39:40 -050035 # Support LF build location
36 cd $path/testsuite/heatbridge
37else
DR695Hccff30b2017-02-17 18:44:24 -050038 cd ~
39 git config --global http.sslVerify false
40 if [ -d ~/heatbridge ]
41 then
42 cd heatbridge
43 git pull origin master
jf98600d5b0bf2017-02-24 14:39:40 -050044 else
Jerry Flooddb798792017-03-29 11:25:30 -040045 git clone https://gerrit.onap.org/r/testsuite/heatbridge.git
DR695Hccff30b2017-02-17 18:44:24 -050046 cd heatbridge
47 fi
48fi
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010049
50pip install \
51--no-cache-dir \
52--upgrade \
53--exists-action s \
54--target="$path/robot/library" \
55./heatbridge
DR695Hccff30b2017-02-17 18:44:24 -050056
Dina Dodinfabd1e82017-08-01 10:53:04 +030057# Go back to execution folder
58cd $path
59
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010060# if the script is running during the image build skip the rest of it
61# as required software is installed already.
62if $BUILDTIME
DR695Hccff30b2017-02-17 18:44:24 -050063then
Dmitry Puzikovb0e12b42019-03-04 11:06:16 +010064 # 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
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010068 echo "Skipping desktop steps, building container image..."
69else
70 #
71 # Get the appropriate chromedriver. Default to linux64
72 #
DR695Hfacbc292019-08-07 11:15:46 -040073 CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/75.0.3770.140
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010074 CHROMEDRIVER_ZIP=chromedriver_linux64.zip
75 CHROMEDRIVER_TARGET=chromedriver.zip
marekpl503647c2018-10-24 14:33:25 +020076
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010077 # 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
DR695H9d810d02019-06-18 17:16:25 -040098fi