-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathJenkinsfile
63 lines (58 loc) · 1.46 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
58
59
60
61
62
63
pipeline {
agent {
label "centos7-generic"
}
stages {
stage('test') {
steps {
sh """
python3.6 -m venv env
. env/bin/activate
pip install --upgrade pip setuptools
pip install -e .[test]
pytest
"""
}
}
stage('package') {
steps {
sh """
rm -rf dist
python3.6 -m venv env
. env/bin/activate
pip install --upgrade pip setuptools wheel
python setup.py sdist bdist_wheel
"""
}
}
stage('approve-deploy') {
agent none
steps {
timeout(time: 14, unit: 'DAYS') {
input message: 'Deploy to prod?'
}
}
}
stage('deploy') {
environment {
TWINE = credentials('pypi-cmbrad')
}
steps {
sh """
export TWINE_USERNAME=${TWINE_USR}
export TWINE_PASSWORD=${TWINE_PSW}
python3.6 -m venv env
. env/bin/activate
pip install --upgrade pip setuptools
pip install twine
twine upload dist/*
"""
}
}
}
post {
always {
cleanWs()
}
}
}