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

This commit is contained in:
David Prevot 2022-05-02 10:27:32 +02:00
parent 205e699355
commit 835072c1e2

50
.Jenkinsfile Normal file
View file

@ -0,0 +1,50 @@
pipeline {
agent { label 'docker' }
environment {
ROLES_VERSION = "${env.GIT_COMMIT}"
}
stages {
stage('Build tagged docker image') {
when {
buildingTag()
}
steps {
script {
def im = docker.build("evolix/ansible-roles:build${env.BUILD_ID}")
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 latest docker image') {
when {
branch 'unstable'
}
steps {
script {
def im = docker.build("evolix/ansible-roles:build${env.BUILD_ID}")
im.inside {
sh 'echo Test needed'
}
/* No crendentials yet
im.push('latest')
*/
}
}
}
}
}