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' \ |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 26 | 'robotframework-archivelibrary==0.4.0' \ |
| 27 | 'robotframework-jsonlibrary==0.3.1' |
DR695H | 3cef788 | 2019-10-11 10:54:08 -0400 | [diff] [blame] | 28 | |
| 29 | pip install \ |
| 30 | --pre \ |
| 31 | --no-cache-dir \ |
| 32 | --exists-action s \ |
| 33 | --target="$path/robot/library" \ |
| 34 | --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" \ |
DR695H | b0e9267 | 2019-10-07 10:41:33 -0400 | [diff] [blame] | 35 | 'robotframework-onap==0.6.0.*' |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 36 | |
DR695H | facbc29 | 2019-08-07 11:15:46 -0400 | [diff] [blame] | 37 | # i dont why we need this, but lets protobuf work in docker |
| 38 | touch /var/opt/ONAP/robot/library/google/__init__.py |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 39 | |
Brian Freeman | d2aa352 | 2020-11-24 09:41:38 -0500 | [diff] [blame] | 40 | ############################### |
| 41 | # remove heatbridge |
| 42 | # commented out for testing |
| 43 | ################################################################ |
| 44 | #if [ -d $path/testsuite/heatbridge ] |
| 45 | #then |
| 46 | # # Support LF build location |
| 47 | # cd $path/testsuite/heatbridge |
| 48 | #else |
| 49 | # cd ~ |
| 50 | # git config --global http.sslVerify false |
| 51 | # if [ -d ~/heatbridge ] |
| 52 | # then |
| 53 | # cd heatbridge |
| 54 | # git pull origin master |
| 55 | # else |
| 56 | # git clone https://gerrit.onap.org/r/testsuite/heatbridge.git |
| 57 | # cd heatbridge |
| 58 | # fi |
| 59 | #fi |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 60 | |
Brian Freeman | d2aa352 | 2020-11-24 09:41:38 -0500 | [diff] [blame] | 61 | #pip install \ |
| 62 | #--no-cache-dir \ |
| 63 | #--upgrade \ |
| 64 | #--exists-action s \ |
| 65 | #--target="$path/robot/library" \ |
| 66 | #./heatbridge |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 67 | |
Brian Freeman | d2aa352 | 2020-11-24 09:41:38 -0500 | [diff] [blame] | 68 | #sed -i 's/cinderclient\.v1\.client/cinderclient\.v2\.client/g' /var/opt/ONAP/robot/library/heatbridge/OpenstackManager.py |
| 69 | |
| 70 | ################################################################ |
DR695H | 51fcd0e | 2019-10-04 14:14:32 -0400 | [diff] [blame] | 71 | |
Dina Dodin | fabd1e8 | 2017-08-01 10:53:04 +0300 | [diff] [blame] | 72 | # Go back to execution folder |
| 73 | cd $path |
| 74 | |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 75 | # if the script is running during the image build skip the rest of it |
| 76 | # as required software is installed already. |
| 77 | if $BUILDTIME |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 78 | then |
Dmitry Puzikov | b0e12b4 | 2019-03-04 11:06:16 +0100 | [diff] [blame] | 79 | # we need to update PATH with chromium-chromedriver |
| 80 | echo "Adding in-container chromedriver to PATH" |
| 81 | ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 82 | |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 83 | echo "Skipping desktop steps, building container image..." |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 84 | else |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 85 | # |
| 86 | # Get the appropriate chromedriver. Default to linux64 |
| 87 | # |
DR695H | facbc29 | 2019-08-07 11:15:46 -0400 | [diff] [blame] | 88 | CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/75.0.3770.140 |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 89 | CHROMEDRIVER_ZIP=chromedriver_linux64.zip |
| 90 | CHROMEDRIVER_TARGET=chromedriver.zip |
marekpl | 503647c | 2018-10-24 14:33:25 +0200 | [diff] [blame] | 91 | |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame] | 92 | # Handle mac and windows |
| 93 | OS=`uname -s` |
| 94 | case $OS in |
| 95 | MINGW*_NT*) |
| 96 | CHROMEDRIVER_ZIP=chromedriver_win32.zip |
| 97 | ;; |
| 98 | Darwin*) |
| 99 | CHROMEDRIVER_ZIP=chromedriver_mac64.zip |
| 100 | ;; |
| 101 | *) echo "Defaulting to Linux 64" ;; |
| 102 | esac |
| 103 | |
| 104 | if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ] |
| 105 | then |
| 106 | curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET |
| 107 | unzip chromedriver.zip -d /usr/local/bin |
| 108 | else |
| 109 | curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET |
| 110 | unzip $CHROMEDRIVER_TARGET |
| 111 | fi |
| 112 | rm -rf $CHROMEDRIVER_TARGET |
Brian Freeman | d2aa352 | 2020-11-24 09:41:38 -0500 | [diff] [blame] | 113 | fi |