adding check to jenkinsfile for repo existence
This commit is contained in:
1 parent
2e5a39eccf
commit
eba1c3d1e2
1 file changed
+14
-4
@@ -82,10 +82,20 @@ pipeline {
|
|||||||
sh """
|
sh """
|
||||||
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
|
||||||
echo ==MC== Initiating BLE test in Screen session ble_test_${env.TEST_HASH}
|
echo ==MC== Initiating BLE test in Screen session ble_test_${env.TEST_HASH}
|
||||||
sleep 5
|
|
||||||
echo ==MC== Pulling code changes from Gitea...
|
if [ ! -d /opt/ble-test/ble_api/.git ]; then
|
||||||
cd /opt/ble-test/ble_api
|
echo ==MC== Directory /opt/ble-test/ble_api missing - creating & cloning repo...
|
||||||
git pull
|
# Create parent folder if necessary
|
||||||
|
mkdir -p /opt/ble-test
|
||||||
|
# Pull the latest copy of the repo
|
||||||
|
git clone https://gitea.matt-cloud.com/matt/ble_api.git /opt/ble-test/ble_api
|
||||||
|
else
|
||||||
|
echo ==MC== Pulling code changes from Gitea...
|
||||||
|
cd /opt/ble-test/ble_api
|
||||||
|
git pull
|
||||||
|
fi
|
||||||
|
sleep 2
|
||||||
|
|
||||||
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...
|
echo ==MC== BLE Test running...
|
||||||
|
|||||||
Reference in new issue
Block a user