Skip to content

Commit 0273b6b

Browse files
Refactor Jenkinsfile: streamline Python setup and archive results stage
1 parent 260b302 commit 0273b6b

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

jenkins/Jenkinsfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ pipeline {
1515
stage('Setup Python') {
1616
steps {
1717
sh '''#!/bin/bash
18-
# Upgrade pip, setuptools, and wheel
1918
python3 -m venv venv
2019
. venv/bin/activate
2120
22-
pip uninstall codeql-wrapper -y
21+
pip uninstall codeql-wrapper -y || true
2322
2423
echo "Upgrading pip, setuptools, and wheel..."
2524
python3 -m pip install --upgrade --force-reinstall pip setuptools wheel packaging gitpython==3.1.45
@@ -35,19 +34,19 @@ pipeline {
3534
. venv/bin/activate
3635
echo "Base Ref (Target Branch): $CHANGE_TARGET"
3736
echo "Ref (Source Branch): $CHANGE_BRANCH"
38-
37+
3938
curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user
40-
39+
4140
codeql-wrapper --verbose analyze ./monorepo --monorepo --upload-sarif --ref $CHANGE_BRANCH --base-ref $CHANGE_TARGET
4241
'''
4342
}
4443
}
4544
}
46-
}
47-
48-
post {
49-
always {
50-
archiveArtifacts artifacts: 'codeql-results/**/*', allowEmptyArchive: true
45+
46+
stage('Archive Results') {
47+
steps {
48+
archiveArtifacts artifacts: 'codeql-results/**/*', allowEmptyArchive: true
49+
}
5150
}
5251
}
5352
}

0 commit comments

Comments
 (0)