Commit 235ead49 authored by BorjaEst's avatar BorjaEst
Browse files

Added Docker-hub upload to pipeline

parent 2d9d065f
pipeline {
agent { dockerfile true }
environment {
registry = "boressan/cicd"
registryCredential = 'dockerhub_id'
}
agent any
stages {
stage('Image build') {
steps {
echo '====================building image===================================='
script { customImage = docker.build(registry) }
}
}
stage('Unit testing') {
steps {
echo '====================executing unittest================================'
sh 'tox'
script { customImage.inside("--entrypoint=''") {sh 'tox'} }
}
}
stage('Docker-hub upload') {
steps {
echo '====================uploading docker-hub=============================='
script { docker.withRegistry('', registryCredential) { customImage.push() } }
}
}
}
......
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