-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
57 lines (55 loc) · 1.67 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// vim: set ft=groovy :
pipeline {
agent {
docker {
image 'quay.io/pypa/manylinux_2_28_x86_64:2024-10-21-dc83211'
args '--entrypoint=manylinux-entrypoint --user=root:root'
}
}
environment {
NO_COLOR = '1'
NO_DEPLOY = '1'
PIP_PROGRESS_BAR = 'off'
PIP_ROOT_USER_ACTION = 'ignore'
PRE_COMMIT_COLOR = 'never'
TOX_PARALLEL_NO_SPINNER = '1'
_PATH = "/opt/python/cp313-cp313/bin:/opt/python/cp312-cp312/bin:/opt/python/cp311-cp311/bin:/opt/python/cp310-cp310/bin:${env.PATH}"
}
options {
buildDiscarder(logRotator(daysToKeepStr: '7'))
timeout(time: 15, unit: 'MINUTES')
}
stages {
stage('init') {
steps {
sh 'dnf --assumeyes --setopt=install_weak_deps=False -- install git'
sh 'git config --global --add safe.directory "*"'
sh 'git config --global user.name Jenkins'
sh 'git config --global user.email [email protected]'
sh 'env -- PATH="${_PATH}" python -m pip install --upgrade -- pip setuptools wheel'
sh 'env -- PATH="${_PATH}" python -m pip install --upgrade -- build cookiecutter pkginfo pre-commit tox twine'
}
}
stage('build') {
steps {
sh 'env -- PATH="${_PATH}" ./build.sh'
}
}
stage('deploy') {
when {
branch 'main'
}
steps {
withCredentials([usernamePassword(credentialsId: '00000000-0000-0000-0000-000000000000', passwordVariable: 'TWINE_PASSWORD', usernameVariable: 'TWINE_USERNAME')]) {
sh 'env -- PATH="${_PATH}" ./deploy.sh'
}
}
}
}
post {
always {
junit(allowEmptyResults: true, testResults: 'output/report/junit/*.xml')
cleanWs()
}
}
}