Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update jenkins config to use shared pipeline
- Loading branch information
1 parent
f82dcc6
commit 28c700e
Showing
3 changed files
with
26 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,17 @@ | ||
#!/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/' | ||
} | ||
} | ||
} | ||
} | ||
// Include this shared CI repository to load script helpers and libraries. | ||
library identifier: 'vapor@1.0.0-RC4', retriever: modernSCM([ | ||
$class: 'GitSCMSource', | ||
remote: 'https://github.com/vapor-ware/ci-shared.git', | ||
credentialsId: 'vio-bot-gh', | ||
]) | ||
|
||
pythonPipeline([ | ||
'pythonVersion': '3.8', | ||
'twineCredential': 'pypi-token-kubetest-upload', | ||
'skipIntegrationTest': true, | ||
'skipDocker': true, | ||
'releaseToPypi': true, | ||
'publishToGitHub': true, | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters