forked from santiment/sanpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
34 lines (29 loc) · 1.01 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
podTemplate(label: 'sanpy-builder', containers: [
containerTemplate(name: 'python', image: 'python:3.8-buster', command: 'cat', ttyEnabled: true)
]) {
node('sanpy-builder') {
stage('Run Tests') {
container('python') {
def scmVars = checkout scm
sh "python3 setup.py test"
}
}
stage('Update deployment') {
container('python') {
if (env.BRANCH_NAME == "master") {
withCredentials([
usernamePassword(
credentialsId: 'test_pypi_org',
passwordVariable: 'test_pypi_org_psw',
usernameVariable: 'test_pypi_org_usr'
)
]){
sh "python3 -m pip install --user --upgrade setuptools>=38.6.0 wheel>=0.31.0 twine>=1.11.0"
sh "python3 setup.py sdist bdist_wheel"
sh "~/.local/bin/twine upload -u ${test_pypi_org_usr} -p ${test_pypi_org_psw} --repository-url https://test.pypi.org/legacy/ dist/*"
}
}
}
}
}
}