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" \ |
| 20 | 'selenium<=3.0.0' \ |
| 21 | 'requests==2.11.1' \ |
| 22 | 'robotframework-selenium2library==1.8.0' \ |
| 23 | 'robotframework-databaselibrary==0.8.1' \ |
| 24 | 'robotframework-extendedselenium2library==0.9.1' \ |
| 25 | 'robotframework-requests==0.5.0' \ |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 26 | 'robotframework-sshlibrary==2.1.2' \ |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame^] | 27 | 'robotframework-sudslibrary==0.8' \ |
| 28 | 'robotframework-ftplibrary==1.3' \ |
| 29 | 'robotframework-rammbock==0.4.0.1' \ |
| 30 | 'deepdiff==2.5.1' \ |
| 31 | 'dnspython==1.15.0' \ |
| 32 | 'robotframework-httplibrary==0.4.2' \ |
| 33 | 'robotframework-archivelibrary==0.3.2' \ |
| 34 | 'PyYAML==3.12' \ |
marekpl | 503647c | 2018-10-24 14:33:25 +0200 | [diff] [blame] | 35 | 'robotframework-kafkalibrary==0.0.2' |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 36 | |
| 37 | |
| 38 | # get the git for the eteutils you will need to add a private key to your ssh before this |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 39 | if [ -d $path/testsuite/eteutils ] |
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/eteutils |
| 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 ~/python-testing-utils ] |
| 47 | then |
| 48 | cd python-testing-utils |
| 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/python-testing-utils.git |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 52 | cd python-testing-utils |
| 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" . |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 61 | |
| 62 | |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 63 | if [ -d $path/testsuite/heatbridge ] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 64 | then |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 65 | # Support LF build location |
| 66 | cd $path/testsuite/heatbridge |
| 67 | else |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 68 | cd ~ |
| 69 | git config --global http.sslVerify false |
| 70 | if [ -d ~/heatbridge ] |
| 71 | then |
| 72 | cd heatbridge |
| 73 | git pull origin master |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 74 | else |
Jerry Flood | db79879 | 2017-03-29 11:25:30 -0400 | [diff] [blame] | 75 | git clone https://gerrit.onap.org/r/testsuite/heatbridge.git |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 76 | cd heatbridge |
| 77 | fi |
| 78 | fi |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame^] | 79 | |
| 80 | pip install \ |
| 81 | --no-cache-dir \ |
| 82 | --upgrade \ |
| 83 | --exists-action s \ |
| 84 | --target="$path/robot/library" \ |
| 85 | ./heatbridge |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 86 | |
| 87 | |
| 88 | # NOTE: Patch to incude explicit install of paramiko to 2.0.2 to work with sshlibrary 2.1.2 |
| 89 | # This should be removed on new release of paramiko (2.1.2) or sshlibrary |
| 90 | # https://github.com/robotframework/SSHLibrary/issues/157 |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame^] | 91 | pip install \ |
| 92 | --no-cache-dir \ |
| 93 | --target="$path/robot/library" \ |
| 94 | -U 'paramiko==2.0.2' |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 95 | |
Dina Dodin | fabd1e8 | 2017-08-01 10:53:04 +0300 | [diff] [blame] | 96 | |
| 97 | # Go back to execution folder |
| 98 | cd $path |
| 99 | |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame^] | 100 | # if the script is running during the image build skip the rest of it |
| 101 | # as required software is installed already. |
| 102 | if $BUILDTIME |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 103 | then |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame^] | 104 | echo "Skipping desktop steps, building container image..." |
| 105 | else |
| 106 | # |
| 107 | # Get the appropriate chromedriver. Default to linux64 |
| 108 | # |
| 109 | CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/2.43 |
| 110 | CHROMEDRIVER_ZIP=chromedriver_linux64.zip |
| 111 | CHROMEDRIVER_TARGET=chromedriver.zip |
marekpl | 503647c | 2018-10-24 14:33:25 +0200 | [diff] [blame] | 112 | |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame^] | 113 | # Handle mac and windows |
| 114 | OS=`uname -s` |
| 115 | case $OS in |
| 116 | MINGW*_NT*) |
| 117 | CHROMEDRIVER_ZIP=chromedriver_win32.zip |
| 118 | ;; |
| 119 | Darwin*) |
| 120 | CHROMEDRIVER_ZIP=chromedriver_mac64.zip |
| 121 | ;; |
| 122 | *) echo "Defaulting to Linux 64" ;; |
| 123 | esac |
| 124 | |
| 125 | if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ] |
| 126 | then |
| 127 | curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET |
| 128 | unzip chromedriver.zip -d /usr/local/bin |
| 129 | else |
| 130 | curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET |
| 131 | unzip $CHROMEDRIVER_TARGET |
| 132 | fi |
| 133 | rm -rf $CHROMEDRIVER_TARGET |
| 134 | fi |
marekpl | 503647c | 2018-10-24 14:33:25 +0200 | [diff] [blame] | 135 | |
| 136 | # |
| 137 | # Install kafkacat : https://github.com/edenhill/kafkacat |
| 138 | # |
| 139 | OS=`uname -s` |
| 140 | case $OS in |
| 141 | Darwin) |
| 142 | brew install kafkacat ;; |
| 143 | Linux) |
| 144 | apt-get -y install kafkacat |
| 145 | esac |
marekpl | 083c558 | 2018-10-26 10:54:32 +0200 | [diff] [blame] | 146 | # |
| 147 | # Install protobuf |
| 148 | # |
| 149 | OS=`uname -s` |
| 150 | case $OS in |
| 151 | Darwin) |
| 152 | brew install protobuf ;; |
| 153 | Linux) |
| 154 | apt-get -y install protobuf-compiler |
Puzikov Dmitry | 38bcba6 | 2019-02-15 16:58:35 +0100 | [diff] [blame^] | 155 | esac |