From 803752e887227435f4c8b719943e3f4d9f4d142a Mon Sep 17 00:00:00 2001 From: Benedikt Kristinsson Date: Fri, 29 Jan 2021 18:42:35 +0100 Subject: [PATCH] using shared jenkins library --- Jenkinsfile | 53 ++--------------------------------------------------- 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7f09fa0..c22aa7b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,52 +1,3 @@ -pipeline { - agent any - options { - timestamps() - ansiColor("xterm") - disableConcurrentBuilds() - } - environment { - NAME="${JOB_NAME.split('/')[1]}" - } - stages { - stage('build container') { - steps { - sh "docker build -t benediktkr/${NAME}:latest ." - } - } +@Library('jenkinsfiles') _ - stage('build package') { - steps { - sh "docker run --name ${NAME}_jenkins benediktkr/${NAME}:latest build --ansi" - sh "docker cp ${NAME}_jenkins:/sudois/dist ." - } - } - - stage('docker publish latest') { - when { not { tag "v*" } } - steps { - sh "docker push benediktkr/${NAME}:latest" - } - } - - stage('docker publish version') { - when { tag "v*" } - steps { - sh "docker tag benediktkr/${NAME}:latest benediktkr/${NAME}:${TAG_NAME}" - sh "docker push benediktkr/${NAME}:${TAG_NAME}" - } - } - } - - post { - success { - archiveArtifacts artifacts: 'dist/*.tar.gz,dist/*.whl', fingerprint: true - } - cleanup { - sh "docker rm ${NAME}_jenkins" - cleanWs(deleteDirs: true, - disableDeferredWipeout: true, - notFailBuild: true) - } - } -} +pythondocker docker: true -- 2.40.1