Update Jenkinsfile

This commit is contained in:
jassim 2025-06-13 12:15:51 +00:00
parent 4f582db699
commit 1bf9e05de8

12
Jenkinsfile vendored
View File

@ -2,13 +2,13 @@ pipeline {
agent any agent any
environment { environment {
SSH_CREDENTIALS = 'exceed-sleep' SSH_CREDENTIALS = 'spurrin-backend-dev'
REMOTE_SERVER = 'ubuntu@160.187.167.106' REMOTE_SERVER = 'ubuntu@160.187.166.67'
REMOTE_WORKSPACE = '/var/www/html' REMOTE_WORKSPACE = '/var/www/html'
GIT_CREDENTIALS = 'git-cred' GIT_CREDENTIALS = 'git-cred'
BACKEND_TEST_DIR = 'Spurrin_Backend_Test' BACKEND_TEST_DIR = 'Spurrin_Backend_Test'
BACKEND_TEST_REPO = 'https://git.tech4biz.wiki/Tech4biz/Spurrin_Backend_Test.git' BACKEND_TEST_REPO = 'https://git.tech4biz.wiki/Tech4biz/Spurrin_Backend_Test.git'
BACKEND_TEST_ENV = '/home/ubuntu/test' BACKEND_TEST_ENV = '/home/ubuntu/testenv'
} }
stages { stages {
@ -56,9 +56,9 @@ pipeline {
sh """ sh """
ssh ${REMOTE_SERVER} ' ssh ${REMOTE_SERVER} '
set -e set -e
rm -rf ${BACKEND_TEST_ENV}/${BACKEND_TEST_DIR} rm -rf ${BACKEND_TEST_DIR}
git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@${BACKEND_TEST_REPO} ${BACKEND_TEST_ENV}/${BACKEND_TEST_DIR} git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@${BACKEND_TEST_REPO}
cd ${BACKEND_TEST_ENV}/${BACKEND_TEST_DIR} cd ${BACKEND_TEST_DIR}
chmod +x run_tests.sh chmod +x run_tests.sh
source ${BACKEND_TEST_ENV}/venv/bin/activate source ${BACKEND_TEST_ENV}/venv/bin/activate
./run_tests.sh > backend_pytest_output.log 2>&1 || ( ./run_tests.sh > backend_pytest_output.log 2>&1 || (