Commit f8205aa1 authored by Saliou's avatar Saliou

first commit

parent 88eadb69
pipeline {
agent any
environment {
registry = "baamtu/docker-demo:master"
registryCredential = 'dockerhub'
dockerImage = ''
}
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Build and push image') {
steps {
script {
echo 'Build..'
def version = readFile('VERSION')
def versions = version.split('\\.')
def major = versions[0]
def minor = versions[0] + '.' + versions[1]
def patch = version.trim()
docker.withRegistry('', 'dockerhub') {
def image = docker.build('baamtu/docker-demo:master',' -f ./Dockerfile .')
image.push()
}
}
}
}
stage('Cleaning up') {
steps {
sh "yes | docker system prune -a"
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment