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