summaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/resources/ci/scripts/copyToStorage.sh
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-03-11 09:34:34 +0200
committerIttay Stern <ittay.stern@att.com>2019-03-17 17:02:43 +0200
commit66af8b9b391879be78660d6ccb0a1f1f9340b423 (patch)
treefc0d510f7ea28a437bcb1e3b950d1281ac88a4e4 /vid-automation/src/main/resources/ci/scripts/copyToStorage.sh
parent37ad0cc1d36ec6ff68ec39fcaaf2617eef7d08fe (diff)
Merge automation from ECOMP's repository
Reference commit in ECOMP: 8e92a8c6 Issue-ID: VID-378 Change-Id: Ia32f4813378ef95097f788246aa5b1172e20ca48 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/main/resources/ci/scripts/copyToStorage.sh')
-rw-r--r--vid-automation/src/main/resources/ci/scripts/copyToStorage.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/vid-automation/src/main/resources/ci/scripts/copyToStorage.sh b/vid-automation/src/main/resources/ci/scripts/copyToStorage.sh
new file mode 100644
index 000000000..86fcadfef
--- /dev/null
+++ b/vid-automation/src/main/resources/ci/scripts/copyToStorage.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+REPORT_NAME=$1
+VERSION=$2
+ENV=$3
+
+if [ -z "$REPORT_NAME" ]
+ then
+ source ExtentReport/versions.info
+ now=$(date +'%Y-%m-%d_%H_%M')
+ REPORT_NAME="${now}"
+ VERSION="${osVersion}"
+ if [[ $env == *"DEV20"* ]]
+ then
+ ENV="Nightly"
+ else
+ ENV=""
+ fi
+
+ fi
+
+/usr/bin/expect << EOF
+spawn ssh admin@135.76.210.45 mkdir -p -m 775 /home/admin/reports/${ENV}/${VERSION}/UI/
+
+expect {
+ -re ".*es.*o.*" {
+ exp_send "yes\r"
+ exp_continue
+ }
+ -re ".*sword.*" {
+ exp_send "Aa123456\r"
+ }
+}
+
+expect eof
+
+spawn scp -pr ExtentReport admin@135.76.210.45:/home/admin/reports/${ENV}/${VERSION}/UI/${REPORT_NAME}/
+
+expect {
+ -re ".*es.*o.*" {
+ exp_send "yes\r"
+ exp_continue
+ }
+ -re ".*sword.*" {
+ exp_send "Aa123456\r"
+ }
+}
+
+expect eof
+EOF