-
Notifications
You must be signed in to change notification settings - Fork 29
/
Jenkinsfile
52 lines (44 loc) · 1.3 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
podTemplate(label: 'sanpy-builder', containers: [
containerTemplate(name: 'python', image: 'python:3.8-buster', command: 'cat', ttyEnabled: true)
]) {
node('sanpy-builder') {
stage('Checkout') {
container('python') {
checkout scm
}
}
stage('Install Dependencies') {
container('python') {
sh "pip install pipenv"
sh "pipenv install --dev"
}
}
stage('Run Linter') {
container('python') {
sh "pipenv run ruff check ."
}
}
stage('Run Tests') {
container('python') {
sh "pipenv run pytest"
}
}
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/*"
}
}
}
}
}
}