-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
50 lines (48 loc) · 1.49 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
#!groovy
pipeline {
agent none
stages {
stage('container') {
agent {
dockerfile {
args '-v ${HOME}/bin:${HOME}/bin'
additionalBuildArgs '--build-arg BUILDER_UID=$(id -u)'
}
}
stages {
stage('clean') {
steps {
sh 'git reset --hard'
sh 'git clean -xffd'
}
}
stage('release') {
when { branch 'master' }
steps {
withCredentials([usernamePassword(credentialsId: env.GIT_CREDENTIALS_ID, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh './bumpversion.sh'
}
}
}
stage('test') {
steps {
sh 'pip install --user -r test_requirements.txt'
sh 'pytest'
}
}
stage('package') {
steps {
sh 'python -m build -w'
}
}
}
post {
success {
dir('dist/') {
archiveArtifacts artifacts: '*.whl', fingerprint: true, onlyIfSuccessful: true
}
}
}
}
}
}