This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcleanup_tests.sh
38 lines (29 loc) · 1.58 KB
/
cleanup_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
echo -e "##########################################\n#\n# Cleanup\n#\n##########################################"
cd "$WORKSPACE"
rm -rf remotelogs
mkdir -p remotelogs/gw/vcs
mkdir -p remotelogs/node/vcs
ssh -t -t jenkins@${HOSTNAME}-gw-ext.qa.voxeolabs.net <<-EOF
sudo /opt/voxeo/prism/bin/prism stop as
sudo /opt/voxeo/prism/bin/prism stop ms
echo Stopped
exit
EOF
ssh jenkins@${HOSTNAME}-node-ext.qa.voxeolabs.net <<-EOF
sudo /opt/voxeo/prism/bin/prism stop as
sudo /opt/voxeo/prism/bin/prism stop ms
echo Stopped
exit
EOF
scp jenkins@${HOSTNAME}-gw-ext.qa.voxeolabs.net:/opt/voxeo/prism/logs/sipmethod.log* remotelogs/gw
scp jenkins@${HOSTNAME}-gw-ext.qa.voxeolabs.net:/opt/voxeo/prism/logs/vcs/log* remotelogs/gw/vcs
scp jenkins@${HOSTNAME}-node-ext.qa.voxeolabs.net:/opt/voxeo/prism/logs/sipmethod.log* remotelogs/node
scp jenkins@${HOSTNAME}-node-ext.qa.voxeolabs.net:/opt/voxeo/prism/logs/vcs/log* remotelogs/node/vcs
echo -e "##########################################\n#\n# Make sure no instances are still running\n#\n##########################################"
knife ec2 server delete `knife search node "name:${HOSTNAME}-gw.qa.voxeolabs.net" -Fj | grep instance_id | awk 'BEGIN{FS="\""} {print $4}'` -y
knife client delete ${HOSTNAME}-gw.qa.voxeolabs.net -y
knife node delete ${HOSTNAME}-gw.qa.voxeolabs.net -y
knife ec2 server delete `knife search node "name:${HOSTNAME}-node.qa.voxeolabs.net" -Fj | grep instance_id | awk 'BEGIN{FS="\""} {print $4}'` -y
knife client delete ${HOSTNAME}-node.qa.voxeolabs.net -y
knife node delete ${HOSTNAME}-node.qa.voxeolabs.net -y