Merge "bug fixing uCPE"
[eliot.git] / jjb / eliot / eliot-deploy.sh
1 #!/bin/bash
2
3 set -x
4
5 echo "CLEANUP Prometheus and Cadvisor started...."
6 echo "-------------------------------------------------------"
7 cd $WORKSPACE/scripts/ci_management
8 ./cleanup_prom_cadvisor.sh
9
10 sshpass -f /home/jenkins/pwfile.txt ssh root@10.10.0.99 "bash -s" < ./uninstall_cadvisor.sh || true
11
12
13 echo "CLEANUP prometheus and Cadvisor ended......"
14 echo "-------------------------------------------------------"
15
16 # log info to console
17 echo "Starting the deployment on baremetal environment using $INSTALLER_TYPE. This could take some time..."
18 echo "--------------------------------------------------------"
19 echo
20
21 rm -rf $WORKSPACE/scripts/nodelist
22
23 cp /home/jenkins/nodelist $WORKSPACE/scripts/nodelist
24
25 cd $WORKSPACE/scripts/
26 ./setup.sh
27
28 if [ $? -ne 0 ]; then
29     echo "depolyment failed!"
30     deploy_ret=1
31 fi
32
33 sleep 60
34 kubectl get nodes
35
36 echo "Logs uploading to nexus repo"
37
38 export ARCHIVE_ARTIFACTS="**/*.log"
39 export NEXUS_URL=https://nexus.akraino.org
40 export SILO=huawei
41 export JENKINS_HOSTNAME=http://159.138.47.166:8080
42 export BUILD_URL="${JENKINS_HOSTNAME}/job/${JOB_NAME}/${BUILD_NUMBER}"
43 export NEXUS_PATH="${SILO}/job/${JOB_NAME}/${BUILD_NUMBER}"
44 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
45 lftools deploy logs $NEXUS_URL $NEXUS_PATH $BUILD_URL
46
47 echo $BUILD_URL
48
49 echo "Logs uploaded to $NEXUS_URL/content/sites/logs/$NEXUS_PATH"
50
51 echo
52 echo "--------------------------------------------------------"
53 echo "Done!"
54
55 exit $deploy_ret
56