forked from vapor-ware/kubetest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.jenkins
72 lines (63 loc) · 1.54 KB
/
.jenkins
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
64
65
66
67
68
69
70
71
72
#!/usr/bin/env groovy
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
}
// Clean up the workspace
stage('Clean') {
steps {
sh 'make clean'
}
}
// Lint the source code.
stage('Lint') {
steps {
sh 'make lint'
}
}
// Run project unit tests.
stage('Test') {
steps {
sh 'make test'
}
}
// Build and distribute a new package version to PyPi.
stage('Publish to PyPi') {
when {
buildingTag()
}
environment {
TWINE_USERNAME = 'vaporio'
TWINE_PASSWORD = credentials('twine-password')
}
steps {
// publish to pypi
sh 'tox -e publish'
}
}
// Generate a new release draft on GitHub for a tag matching a version string
// pattern. The release will include an auto-generated changelog and build
// artifacts.
stage('Draft GitHub Release') {
when {
buildingTag()
}
environment {
GITHUB_USER = 'vapor-ware'
GITHUB_TOKEN = credentials('vio-bot-gh-token')
GITHUB_REPONAME = 'kubetest'
}
steps {
// Auto-generate a changelog for the release
sh './bin/ci/generate_changelog.sh'
// Create the release
sh 'docker pull edaniszewski/ghr'
sh 'docker run --rm -v ${WORKSPACE}:/repo edaniszewski/ghr -u ${GITHUB_USER} -r ${GITHUB_REPONAME} -t ${GITHUB_TOKEN} -b "$(cat ./CHANGELOG.md)" -replace ${TAG_NAME} dist/'
}
}
}
}