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) |
| 16 | |
jf9860 | e770718 | 2017-03-01 12:04:43 -0500 | [diff] [blame] | 17 | pip install --no-cache-dir --target="$path/robot/library" 'selenium<=3.0.0' 'requests==2.11.1' 'robotframework-selenium2library==1.8.0' \ |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 18 | 'robotframework-databaselibrary==0.8.1' 'robotframework-extendedselenium2library==0.9.1' 'robotframework-requests==0.4.5' \ |
| 19 | 'robotframework-sshlibrary==2.1.2' \ |
| 20 | 'robotframework-sudslibrary==0.8' 'robotframework-ftplibrary==1.3' 'robotframework-rammbock==0.4.0.1' \ |
marekpl | 503647c | 2018-10-24 14:33:25 +0200 | [diff] [blame] | 21 | 'deepdiff==2.5.1' 'dnspython==1.15.0' 'robotframework-httplibrary==0.4.2' 'robotframework-archivelibrary==0.3.2' 'PyYAML==3.12' \ |
| 22 | 'robotframework-kafkalibrary==0.0.2' |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 23 | |
| 24 | |
| 25 | # 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] | 26 | if [ -d $path/testsuite/eteutils ] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 27 | then |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 28 | # Support LF build location |
| 29 | cd $path/testsuite/eteutils |
| 30 | else |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 31 | cd ~ |
| 32 | git config --global http.sslVerify false |
| 33 | if [ -d ~/python-testing-utils ] |
| 34 | then |
| 35 | cd python-testing-utils |
| 36 | git pull origin master |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 37 | else |
Jerry Flood | db79879 | 2017-03-29 11:25:30 -0400 | [diff] [blame] | 38 | git clone https://gerrit.onap.org/r/testsuite/python-testing-utils.git |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 39 | cd python-testing-utils |
| 40 | fi |
| 41 | fi |
Jerry Flood | db79879 | 2017-03-29 11:25:30 -0400 | [diff] [blame] | 42 | pip install --no-cache-dir --upgrade --target="$path/robot/library" . |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 43 | |
| 44 | |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 45 | if [ -d $path/testsuite/heatbridge ] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 46 | then |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 47 | # Support LF build location |
| 48 | cd $path/testsuite/heatbridge |
| 49 | else |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 50 | cd ~ |
| 51 | git config --global http.sslVerify false |
| 52 | if [ -d ~/heatbridge ] |
| 53 | then |
| 54 | cd heatbridge |
| 55 | git pull origin master |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 56 | else |
Jerry Flood | db79879 | 2017-03-29 11:25:30 -0400 | [diff] [blame] | 57 | git clone https://gerrit.onap.org/r/testsuite/heatbridge.git |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 58 | cd heatbridge |
| 59 | fi |
| 60 | fi |
DR695H | 3abcd69 | 2017-08-03 12:22:23 -0400 | [diff] [blame] | 61 | pip install --no-cache-dir --upgrade --target="$path/robot/library" ./heatbridge |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 62 | |
| 63 | |
| 64 | # NOTE: Patch to incude explicit install of paramiko to 2.0.2 to work with sshlibrary 2.1.2 |
| 65 | # This should be removed on new release of paramiko (2.1.2) or sshlibrary |
| 66 | # https://github.com/robotframework/SSHLibrary/issues/157 |
Jerry Flood | db79879 | 2017-03-29 11:25:30 -0400 | [diff] [blame] | 67 | pip install --no-cache-dir --target="$path/robot/library" -U 'paramiko==2.0.2' |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 68 | |
Dina Dodin | fabd1e8 | 2017-08-01 10:53:04 +0300 | [diff] [blame] | 69 | |
| 70 | # Go back to execution folder |
| 71 | cd $path |
| 72 | |
| 73 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 74 | # |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 75 | # Get the appropriate chromedriver. Default to linux64 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 76 | # |
Gary Wu | beb8acc | 2018-10-31 20:18:50 -0700 | [diff] [blame] | 77 | CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/2.43 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 78 | CHROMEDRIVER_ZIP=chromedriver_linux64.zip |
| 79 | |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 80 | # Handle mac and windows |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 81 | OS=`uname -s` |
| 82 | case $OS in |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 83 | MINGW*_NT*) |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 84 | CHROMEDRIVER_ZIP=chromedriver_win32.zip |
| 85 | ;; |
| 86 | Darwin*) |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 87 | CHROMEDRIVER_ZIP=chromedriver_mac64.zip |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 88 | ;; |
| 89 | *) echo "Defaulting to Linux 64" ;; |
| 90 | esac |
| 91 | |
| 92 | if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ] |
| 93 | then |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 94 | wget -O chromedriver.zip $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 95 | unzip chromedriver.zip -d /usr/local/bin |
| 96 | else |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 97 | curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o chromedriver.zip |
| 98 | unzip chromedriver.zip |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 99 | fi |
marekpl | 503647c | 2018-10-24 14:33:25 +0200 | [diff] [blame] | 100 | |
| 101 | |
| 102 | # |
| 103 | # Install kafkacat : https://github.com/edenhill/kafkacat |
| 104 | # |
| 105 | OS=`uname -s` |
| 106 | case $OS in |
| 107 | Darwin) |
| 108 | brew install kafkacat ;; |
| 109 | Linux) |
| 110 | apt-get -y install kafkacat |
| 111 | esac |
marekpl | 083c558 | 2018-10-26 10:54:32 +0200 | [diff] [blame] | 112 | |
| 113 | |
| 114 | # |
| 115 | # Install protobuf |
| 116 | # |
| 117 | OS=`uname -s` |
| 118 | case $OS in |
| 119 | Darwin) |
| 120 | brew install protobuf ;; |
| 121 | Linux) |
| 122 | apt-get -y install protobuf-compiler |
| 123 | esac |