jenkinsfile - add some echos, ble is ready to test
This commit is contained in:
1 parent
a1e050c688
commit
2b4b33701e
1 file changed
+6
-3
@@ -42,7 +42,7 @@ pipeline {
|
|||||||
echo ==MC== Disabling MOTD...
|
echo ==MC== Disabling MOTD...
|
||||||
touch .hushlogin
|
touch .hushlogin
|
||||||
scp .hushlogin root@${params.host_ip}:/root/.hushlogin
|
scp .hushlogin root@${params.host_ip}:/root/.hushlogin
|
||||||
|
rm .hushlogin
|
||||||
"""
|
"""
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
// 2. Ensure screen is installed (runs only once)
|
// 2. Ensure screen is installed
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
stage('Ensure screen is present') {
|
stage('Ensure screen is present') {
|
||||||
steps {
|
steps {
|
||||||
@@ -82,7 +82,7 @@ pipeline {
|
|||||||
git pull
|
git pull
|
||||||
cd /opt/ble-test/ble_api/api
|
cd /opt/ble-test/ble_api/api
|
||||||
screen -dmS ble_test_${env.TEST_HASH} bash -c "cd /opt/ble-test/ble_api/api && python3 -u ./ble.py ${params.test_count} | tee /tmp/ble_test_${env.TEST_HASH}.log"
|
screen -dmS ble_test_${env.TEST_HASH} bash -c "cd /opt/ble-test/ble_api/api && python3 -u ./ble.py ${params.test_count} | tee /tmp/ble_test_${env.TEST_HASH}.log"
|
||||||
|
echo ==MC== BLE Test running...
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,6 +117,7 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
sshagent([env.SSH_CREDENTIALS_ID]) {
|
sshagent([env.SSH_CREDENTIALS_ID]) {
|
||||||
sh """
|
sh """
|
||||||
|
echo ==MC== Test is running, monitoring output.
|
||||||
ssh -q -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF
|
ssh -q -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF
|
||||||
while screen -list | grep -q ble_test_${env.TEST_HASH}; do
|
while screen -list | grep -q ble_test_${env.TEST_HASH}; do
|
||||||
tail -f /tmp/ble_test_${env.TEST_HASH}.log || true
|
tail -f /tmp/ble_test_${env.TEST_HASH}.log || true
|
||||||
@@ -136,6 +137,7 @@ pipeline {
|
|||||||
always {
|
always {
|
||||||
sshagent([env.SSH_CREDENTIALS_ID]) {
|
sshagent([env.SSH_CREDENTIALS_ID]) {
|
||||||
sh """
|
sh """
|
||||||
|
echo ==MC== Test complete, cleaning up Screen sessions
|
||||||
ssh -q -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF
|
ssh -q -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF
|
||||||
screen -wipe
|
screen -wipe
|
||||||
if screen -list | grep -q ${env.TEST_HASH}; then
|
if screen -list | grep -q ${env.TEST_HASH}; then
|
||||||
@@ -143,6 +145,7 @@ pipeline {
|
|||||||
screen -S ble_test_${env.TEST_HASH} -X quit
|
screen -S ble_test_${env.TEST_HASH} -X quit
|
||||||
fi
|
fi
|
||||||
rm /tmp/ble_test_${env.TEST_HASH}.log
|
rm /tmp/ble_test_${env.TEST_HASH}.log
|
||||||
|
rm /root/.hushlogin
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user