Updating vagrant log path in CI build
This commit is contained in:
		| @@ -50,7 +50,7 @@ while [ "$MINUTES_PAST" -lt 400 ]; do | ||||
|   STATUS=$(curl $IP_ADDRESS) | ||||
|   if [ "$STATUS" == "building" ]; then | ||||
|     echo "$STATUS" | ||||
|     scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_build.log /tmp/artifacts/vagrant_build.log || echo "Vagrant log not yet present" | ||||
|     scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_up_*.log /tmp/artifacts/|| echo "Vagrant log not yet present" | ||||
|     scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Packer/packer_build.log /tmp/artifacts/packer_build.log || echo "Packer log not yet present" | ||||
|     sleep 300 | ||||
|     ((MINUTES_PAST += 5)) | ||||
| @@ -60,7 +60,7 @@ while [ "$MINUTES_PAST" -lt 400 ]; do | ||||
| done | ||||
| if [ "$MINUTES_PAST" -gt 400 ]; then | ||||
|   echo "Serer timed out. Uptime: $MINUTES_PAST minutes." | ||||
|   scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_build.log /tmp/artifacts/vagrant_build.log || echo "Vagrant log not yet present" | ||||
|   scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_up_*.log /tmp/artifacts/ || echo "Vagrant log not yet present" | ||||
|   scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Packer/packer_build.log /tmp/artifacts/packer_build.log || echo "Packer log not yet present" | ||||
|   curl -X DELETE --header 'Accept: application/json' --header 'X-Auth-Token: '"$PACKET_API_TOKEN" 'https://api.packet.net/devices/'"$DEVICE_ID" | ||||
|   exit 1 | ||||
| @@ -70,7 +70,7 @@ fi | ||||
| echo $STATUS | ||||
| if [ "$STATUS" != "success" ]; then | ||||
|   echo "Build failed. Cleaning up server with ID $DEVICE_ID" | ||||
|   scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_build.log /tmp/artifacts/vagrant_build.log || echo "Vagrant log not yet present" | ||||
|   scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_up_*.log /tmp/artifacts/ || echo "Vagrant log not yet present" | ||||
|   scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Packer/packer_build.log /tmp/artifacts/packer_build.log || echo "Packer log not yet present" | ||||
|   curl -X DELETE --header 'Accept: application/json' --header 'X-Auth-Token: '"$PACKET_API_TOKEN" 'https://api.packet.net/devices/'"$DEVICE_ID" | ||||
|   exit 1 | ||||
|   | ||||
| @@ -47,7 +47,7 @@ while [ "$MINUTES_PAST" -lt 120 ]; do | ||||
|   STATUS=$(curl $IP_ADDRESS) | ||||
|   if [ "$STATUS" == "building" ]; then | ||||
|     echo "$STATUS" | ||||
|     scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_build.log /tmp/artifacts/vagrant_build.log || echo "vagrant_build.log not available yet" | ||||
|     scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_up_*.log /tmp/artifacts/ || echo "Vagrant log not yet present" | ||||
|     sleep 300 | ||||
|     ((MINUTES_PAST += 5)) | ||||
|   else | ||||
| @@ -55,7 +55,7 @@ while [ "$MINUTES_PAST" -lt 120 ]; do | ||||
|   fi | ||||
|   if [ "$MINUTES_PAST" -gt 120 ]; then | ||||
|     echo "Serer timed out. Uptime: $MINUTES_PAST minutes." | ||||
|     scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_build.log /tmp/artifacts/vagrant_build.log | ||||
|     scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_up_*.log /tmp/artifacts/ | ||||
|     curl -X DELETE --header 'Accept: application/json' --header 'X-Auth-Token: '"$PACKET_API_TOKEN" 'https://api.packet.net/devices/'"$DEVICE_ID" | ||||
|     exit 1 | ||||
|   fi | ||||
| @@ -64,7 +64,7 @@ done | ||||
| ## Recording the build results | ||||
| echo $STATUS | ||||
| if [ "$STATUS" != "success" ]; then | ||||
|   scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_build.log /tmp/artifacts/vagrant_build.log | ||||
|   scp -i ~/.ssh/id_rsa root@"$IP_ADDRESS":/opt/DetectionLab/Vagrant/vagrant_up_*.log /tmp/artifacts/ | ||||
|   echo "Build failed. Cleaning up server with ID $DEVICE_ID" | ||||
|   curl -X DELETE --header 'Accept: application/json' --header 'X-Auth-Token: '"$PACKET_API_TOKEN" 'https://api.packet.net/devices/'"$DEVICE_ID" | ||||
|   exit 1 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Chris Long
					Chris Long