DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 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 |
Dina Dodin | fabd1e8 | 2017-08-01 10:53:04 +0300 | [diff] [blame] | 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 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 13 | |
| 14 | # get the path |
| 15 | path=$(pwd) |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 16 | pip install \ |
| 17 | --no-cache-dir \ |
| 18 | --exists-action s \ |
| 19 | --target="$path/robot/library" \ |
DR695H | 345c992 | 2019-05-10 15:52:12 -0400 | [diff] [blame] | 20 | --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" \ |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 21 | 'robotframework-seleniumlibrary==3.3.1' \ |
DR695H | 345c992 | 2019-05-10 15:52:12 -0400 | [diff] [blame] | 22 | 'robotframework-databaselibrary==1.2' \ |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 23 | 'robotframework-angularjs==0.0.9' \ |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 24 | 'robotframework-requests==0.5.0' \ |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 25 | 'robotframework-sshlibrary==3.3.0' \ |
DR695H | 345c992 | 2019-05-10 15:52:12 -0400 | [diff] [blame] | 26 | 'robotframework-ftplibrary==1.6' \ |
DR695H | 345c992 | 2019-05-10 15:52:12 -0400 | [diff] [blame] | 27 | 'robotframework-archivelibrary==0.4.0' \ |
DR695H | 2742633 | 2019-05-21 11:26:28 -0400 | [diff] [blame] | 28 | 'robotframework-onap==0.5' |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 29 | |
| 30 | |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 31 | if [ -d $path/testsuite/heatbridge ] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 32 | then |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 33 | # Support LF build location |
| 34 | cd $path/testsuite/heatbridge |
| 35 | else |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 36 | cd ~ |
| 37 | git config --global http.sslVerify false |
| 38 | if [ -d ~/heatbridge ] |
| 39 | then |
| 40 | cd heatbridge |
| 41 | git pull origin master |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 42 | else |
Jerry Flood | db79879 | 2017-03-29 11:25:30 -0400 | [diff] [blame] | 43 | git clone https://gerrit.onap.org/r/testsuite/heatbridge.git |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 44 | cd heatbridge |
| 45 | fi |
| 46 | fi |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 47 | |
| 48 | pip install \ |
| 49 | --no-cache-dir \ |
| 50 | --upgrade \ |
| 51 | --exists-action s \ |
| 52 | --target="$path/robot/library" \ |
| 53 | ./heatbridge |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 54 | |
Dina Dodin | fabd1e8 | 2017-08-01 10:53:04 +0300 | [diff] [blame] | 55 | # Go back to execution folder |
| 56 | cd $path |
| 57 | |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 58 | # if the script is running during the image build skip the rest of it |
| 59 | # as required software is installed already. |
| 60 | if $BUILDTIME |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 61 | then |
Dmitry Puzikov | b0e12b4 | 2019-03-04 11:06:16 +0100 | [diff] [blame] | 62 | # we need to update PATH with chromium-chromedriver |
| 63 | echo "Adding in-container chromedriver to PATH" |
| 64 | ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver |
| 65 | |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 66 | echo "Skipping desktop steps, building container image..." |
| 67 | else |
| 68 | # |
| 69 | # Get the appropriate chromedriver. Default to linux64 |
| 70 | # |
| 71 | CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/2.43 |
| 72 | CHROMEDRIVER_ZIP=chromedriver_linux64.zip |
| 73 | CHROMEDRIVER_TARGET=chromedriver.zip |
marekpl | 503647c | 2018-10-24 14:33:25 +0200 | [diff] [blame] | 74 | |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 75 | # Handle mac and windows |
| 76 | OS=`uname -s` |
| 77 | case $OS in |
| 78 | MINGW*_NT*) |
| 79 | CHROMEDRIVER_ZIP=chromedriver_win32.zip |
| 80 | ;; |
| 81 | Darwin*) |
| 82 | CHROMEDRIVER_ZIP=chromedriver_mac64.zip |
| 83 | ;; |
| 84 | *) echo "Defaulting to Linux 64" ;; |
| 85 | esac |
| 86 | |
| 87 | if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ] |
| 88 | then |
| 89 | curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET |
| 90 | unzip chromedriver.zip -d /usr/local/bin |
| 91 | else |
| 92 | curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET |
| 93 | unzip $CHROMEDRIVER_TARGET |
| 94 | fi |
| 95 | rm -rf $CHROMEDRIVER_TARGET |
DR695H | 9d810d0 | 2019-06-18 17:16:25 -0400 | [diff] [blame^] | 96 | fi |