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' \ |
| 21 | 'deepdiff==2.5.1' 'dnspython==1.15.0' 'robotframework-httplibrary==0.4.2' 'robotframework-archivelibrary==0.3.2' 'PyYAML==3.12' |
| 22 | |
| 23 | |
| 24 | # 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] | 25 | if [ -d $path/testsuite/eteutils ] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 26 | then |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 27 | # Support LF build location |
| 28 | cd $path/testsuite/eteutils |
| 29 | else |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 30 | cd ~ |
| 31 | git config --global http.sslVerify false |
| 32 | if [ -d ~/python-testing-utils ] |
| 33 | then |
| 34 | cd python-testing-utils |
| 35 | git pull origin master |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 36 | else |
Jerry Flood | db79879 | 2017-03-29 11:25:30 -0400 | [diff] [blame] | 37 | git clone https://gerrit.onap.org/r/testsuite/python-testing-utils.git |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 38 | cd python-testing-utils |
| 39 | fi |
| 40 | fi |
Jerry Flood | db79879 | 2017-03-29 11:25:30 -0400 | [diff] [blame] | 41 | pip install --no-cache-dir --upgrade --target="$path/robot/library" . |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 42 | |
| 43 | |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 44 | if [ -d $path/testsuite/heatbridge ] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 45 | then |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 46 | # Support LF build location |
| 47 | cd $path/testsuite/heatbridge |
| 48 | else |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 49 | cd ~ |
| 50 | git config --global http.sslVerify false |
| 51 | if [ -d ~/heatbridge ] |
| 52 | then |
| 53 | cd heatbridge |
| 54 | git pull origin master |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 55 | else |
Jerry Flood | db79879 | 2017-03-29 11:25:30 -0400 | [diff] [blame] | 56 | git clone https://gerrit.onap.org/r/testsuite/heatbridge.git |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 57 | cd heatbridge |
| 58 | fi |
| 59 | fi |
DR695H | 3abcd69 | 2017-08-03 12:22:23 -0400 | [diff] [blame] | 60 | pip install --no-cache-dir --upgrade --target="$path/robot/library" ./heatbridge |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 61 | |
| 62 | |
| 63 | # NOTE: Patch to incude explicit install of paramiko to 2.0.2 to work with sshlibrary 2.1.2 |
| 64 | # This should be removed on new release of paramiko (2.1.2) or sshlibrary |
| 65 | # https://github.com/robotframework/SSHLibrary/issues/157 |
Jerry Flood | db79879 | 2017-03-29 11:25:30 -0400 | [diff] [blame] | 66 | 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] | 67 | |
Dina Dodin | fabd1e8 | 2017-08-01 10:53:04 +0300 | [diff] [blame] | 68 | |
| 69 | # Go back to execution folder |
| 70 | cd $path |
| 71 | |
| 72 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 73 | # |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 74 | # Get the appropriate chromedriver. Default to linux64 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 75 | # |
Jerry Flood | 71b7b0f | 2017-10-02 16:25:06 -0400 | [diff] [blame] | 76 | CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/2.29 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 77 | CHROMEDRIVER_ZIP=chromedriver_linux64.zip |
| 78 | |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 79 | # Handle mac and windows |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 80 | OS=`uname -s` |
| 81 | case $OS in |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 82 | MINGW*_NT*) |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 83 | CHROMEDRIVER_ZIP=chromedriver_win32.zip |
| 84 | ;; |
| 85 | Darwin*) |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 86 | CHROMEDRIVER_ZIP=chromedriver_mac64.zip |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 87 | ;; |
| 88 | *) echo "Defaulting to Linux 64" ;; |
| 89 | esac |
| 90 | |
| 91 | if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ] |
| 92 | then |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 93 | wget -O chromedriver.zip $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 94 | unzip chromedriver.zip -d /usr/local/bin |
| 95 | else |
jf9860 | 0d5b0bf | 2017-02-24 14:39:40 -0500 | [diff] [blame] | 96 | curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o chromedriver.zip |
| 97 | unzip chromedriver.zip |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 98 | fi |