Fix Jenkinsfile to use shell commands for Linux environment

This commit is contained in:
pavan-msys 2026-05-06 12:22:52 +05:30
parent a4adc2e219
commit 55b75f4cf3

14
Jenkinsfile vendored
View File

@ -16,9 +16,9 @@ pipeline {
stage('Setup Python Environment') { stage('Setup Python Environment') {
steps { steps {
echo 'Setting up Python environment...' echo 'Setting up Python environment...'
bat ''' sh '''
python --version python3 --version || python --version
python -m pip install --upgrade pip python3 -m pip install --upgrade pip || python -m pip install --upgrade pip
''' '''
} }
} }
@ -26,8 +26,8 @@ pipeline {
stage('Install Dependencies') { stage('Install Dependencies') {
steps { steps {
echo 'Installing dependencies...' echo 'Installing dependencies...'
bat ''' sh '''
pip install -r requirements.txt pip3 install -r requirements.txt || pip install -r requirements.txt
''' '''
} }
} }
@ -35,7 +35,7 @@ pipeline {
stage('Run Tests') { stage('Run Tests') {
steps { steps {
echo 'Running payment tests...' echo 'Running payment tests...'
bat ''' sh '''
pytest tests/ -v --junitxml=test-results.xml --html=test-report.html --self-contained-html pytest tests/ -v --junitxml=test-results.xml --html=test-report.html --self-contained-html
''' '''
} }
@ -44,7 +44,7 @@ pipeline {
stage('Code Coverage') { stage('Code Coverage') {
steps { steps {
echo 'Generating code coverage report...' echo 'Generating code coverage report...'
bat ''' sh '''
pytest tests/ --cov=src --cov-report=html --cov-report=xml pytest tests/ --cov=src --cov-report=html --cov-report=xml
''' '''
} }