CI: support Jenkins
Some checks failed
gitea.evolix.org on plain agent00/ansible-roles/pipeline/head There was a failure building this commit
continuous-integration/drone/push Build is failing

This commit is contained in:
David Prevot 2022-05-02 10:27:32 +02:00
parent 61cd2b7428
commit 30b5ebb8b3

50
.Jenkinsfile Normal file
View file

@ -0,0 +1,50 @@
pipeline {
agent { label 'docker' }
environment {
ROLES_VERSION = build.getEnvironment(listener).get('GIT_COMMIT')
}
stages {
stage('Build tagged docker image') {
when {
buildingTag()
}
steps {
script {
def im = docker.build("evolix/ansible-roles:build${env.BUILD_ID}", "gbp")
im.inside {
sh 'echo Test needed'
}
def version = TAG_NAME
def versions = version.split('\\.')
def major = versions[0]
def minor = versions[0] + '.' + versions[1]
def patch = version.trim()
/* No crendentials yet
im.push(major)
im.push(minor)
im.push(patch)
*/
}
}
}
stage('Build tagged docker image') {
when {
branch 'unstable'
}
steps {
script {
def im = docker.build("evolix/ansible-roles:build${env.BUILD_ID}", "gbp")
im.inside {
sh 'echo Test needed'
}
/* No crendentials yet
im.push('latest')
*/
}
}
}
}
}