69 lines
1.6 KiB
Groovy
69 lines
1.6 KiB
Groovy
pipeline {
|
|
agent {
|
|
kubernetes {
|
|
yamlFile 'ci/podTemplate.yaml'
|
|
workspaceVolume dynamicPVC()
|
|
}
|
|
}
|
|
|
|
options {
|
|
buildDiscarder logRotator(numToKeepStr: '5')
|
|
disableConcurrentBuilds()
|
|
}
|
|
|
|
environment {
|
|
CARGO_HOME = "${env.WORKSPACE}/.cargo"
|
|
TMPDIR = "${env.WORKSPACE_TMP}"
|
|
}
|
|
|
|
stages {
|
|
stage('Test') {
|
|
steps {
|
|
container('build') {
|
|
withCredentials([file(
|
|
credentialsId: 'dynk8s-test-kubeconfig',
|
|
variable: 'KUBECONFIG'
|
|
)]) {
|
|
sh '. ci/test.sh'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Build') {
|
|
steps {
|
|
container('build') {
|
|
sh '. ci/build.sh'
|
|
}
|
|
}
|
|
post {
|
|
success {
|
|
dir('target/release') {
|
|
archiveArtifacts 'dynk8s-provisioner'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Container') {
|
|
steps {
|
|
container('podman') {
|
|
sh '. ci/container.sh'
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Publish') {
|
|
steps {
|
|
container('podman') {
|
|
withCredentials([usernameColonPassword(
|
|
credentialsId: 'jenkins-packages', variable: 'PODMAN_AUTH'
|
|
)]) {
|
|
sh '. ci/publish.sh'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|