Correct log file storage location
Due to zuul jenkins-job-builder changes, the base folder the CI job was being executed changed. This is okay, however the log collection script only looks in the root of the WORKSPACE folder if present, so we need to identify and default to that folder if defined. Change-Id: I76a2a23e2a75022bae3511700c81145b5cbeae77 Closes-Bug: 1490532
This commit is contained in:
parent
2bb8aee343
commit
37b0c9ce76
@ -1,4 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Note(TheJulia): If there is a workspace variable, we want to utilize that as
|
||||||
|
# the preference of where to put logs
|
||||||
|
LOG_LOCATION=${WORKSPACE:-../logs}
|
||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
export PYTHONUNBUFFERED=1
|
export PYTHONUNBUFFERED=1
|
||||||
@ -51,14 +56,14 @@ if [ $EXITCODE != 0 ]; then
|
|||||||
echo "****************************"
|
echo "****************************"
|
||||||
fi
|
fi
|
||||||
echo "Making logs directory and collecting logs."
|
echo "Making logs directory and collecting logs."
|
||||||
mkdir ../logs
|
mkdir ${LOG_LOCATION}
|
||||||
sudo cp /var/log/libvirt/baremetal_logs/testvm1_console.log ../logs/
|
sudo cp /var/log/libvirt/baremetal_logs/testvm1_console.log ${LOG_LOCATION}/
|
||||||
sudo chown $USER ../logs/testvm1_console.log
|
sudo chown $USER ${LOG_LOCATION}/testvm1_console.log
|
||||||
dmesg &> ../logs/dmesg.log
|
dmesg &> ${LOG_LOCATION}/dmesg.log
|
||||||
sudo netstat -apn &> ../logs/netstat.log
|
sudo netstat -apn &> ${LOG_LOCATION}/netstat.log
|
||||||
sudo iptables -L -n -v &> ../logs/iptables.log
|
sudo iptables -L -n -v &> ${LOG_LOCATION}/iptables.log
|
||||||
sudo cp /var/log/upstart/ironic-api.log ../logs/
|
sudo cp /var/log/upstart/ironic-api.log .${LOG_LOCATION}/
|
||||||
sudo chown $USER ../logs/ironic-api.log
|
sudo chown $USER ${LOG_LOCATION}/ironic-api.log
|
||||||
sudo cp /var/log/upstart/ironic-conductor.log ../logs/
|
sudo cp /var/log/upstart/ironic-conductor.log ${LOG_LOCATION}/
|
||||||
sudo chown $USER ../logs/ironic-conductor.log
|
sudo chown $USER ${LOG_LOCATION}/ironic-conductor.log
|
||||||
exit $EXITCODE
|
exit $EXITCODE
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Note(TheJulia): If there is a workspace variable, we want to utilize that as
|
||||||
|
# the preference of where to put logs
|
||||||
|
LOG_LOCATION=${WORKSPACE:-../logs}
|
||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
export PYTHONUNBUFFERED=1
|
export PYTHONUNBUFFERED=1
|
||||||
@ -47,14 +52,14 @@ if [ $EXITCODE != 0 ]; then
|
|||||||
echo "****************************"
|
echo "****************************"
|
||||||
fi
|
fi
|
||||||
echo "Making logs directory and collecting logs."
|
echo "Making logs directory and collecting logs."
|
||||||
mkdir ../logs
|
mkdir ${LOG_LOCATION}
|
||||||
sudo cp /var/log/libvirt/baremetal_logs/testvm1_console.log ../logs/
|
sudo cp /var/log/libvirt/baremetal_logs/testvm1_console.log ${LOG_LOCATION}
|
||||||
sudo chown $USER ../logs/testvm1_console.log
|
sudo chown $USER ${LOG_LOCATION}/testvm1_console.log
|
||||||
dmesg &> ../logs/dmesg.log
|
dmesg &> ${LOG_LOCATION}/dmesg.log
|
||||||
sudo netstat -apn &> ../logs/netstat.log
|
sudo netstat -apn &> ${LOG_LOCATION}/netstat.log
|
||||||
sudo iptables -L -n -v &> ../logs/iptables.log
|
sudo iptables -L -n -v &> ${LOG_LOCATION}/iptables.log
|
||||||
sudo cp /var/log/upstart/ironic-api.log ../logs/
|
sudo cp /var/log/upstart/ironic-api.log ${LOG_LOCATION}/
|
||||||
sudo chown $USER ../logs/ironic-api.log
|
sudo chown $USER ${LOG_LOCATION}/ironic-api.log
|
||||||
sudo cp /var/log/upstart/ironic-conductor.log ../logs/
|
sudo cp /var/log/upstart/ironic-conductor.log ${LOG_LOCATION}/
|
||||||
sudo chown $USER ../logs/ironic-conductor.log
|
sudo chown $USER ${LOG_LOCATION}/ironic-conductor.log
|
||||||
exit $EXITCODE
|
exit $EXITCODE
|
||||||
|
Loading…
Reference in New Issue
Block a user