From 56ac13fdd41e74bd755bd3c4aa42efdca7637bc7 Mon Sep 17 00:00:00 2001 From: "Stefan E. Funk" <funk@sub.uni-goettingen.de> Date: Thu, 24 Jan 2019 17:24:47 +0100 Subject: [PATCH] adapted Jenkinsfile to gitflow workflow --- Jenkinsfile | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index deaed077..f69bf7a4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,9 +2,9 @@ node { def mvnHome stage('Preparation') { - git 'git://projects.gwdg.de/dariah-de/tg/textgrid-repository/oai-pmh.git' - mvnHome = tool 'Maven 3.0.4' - } + mvnHome = tool 'Maven 3.5.0' + checkout scm +} stage('Build') { sh "'${mvnHome}/bin/mvn' -U clean verify deploy -Pdhrep.deb" @@ -17,27 +17,10 @@ node { def snapshot = pVersion.contains("SNAPSHOT") if (snapshot) { - doDebSnapshot(pName, pVersion) - } else { - doDebRelease(pName, pVersion) + doDebSnapshot(pName, 'target', pVersion, 'trusty') + } + else { + doDebRelease(pName, 'target', pVersion, 'trusty') } } } - -def doDebRelease(pname, pversion) { - echo "Publishing Debian package ${pname} for RELEASE version ${pversion}" - sh "PLOC=\$(ls ${pname}/target/*.deb); curl -X POST -F file=@\${PLOC} http://localhost:8008/api/files/${pname}-${pversion}" - sh "curl -X POST http://localhost:8008/api/repos/releases/file/${pname}-${pversion}" - sh "curl -X PUT -H 'Content-Type: application/json' --data '{}' http://localhost:8008/api/publish/:./trusty" - sh "rm ${pname}/target/*.deb" - sh "rm ${pname}/target/*.changes" -} - -def doDebSnapshot(pname, pversion) { - echo "Publishing Debian package ${pname} for SNAPSHOT version ${pversion}" - sh "PLOC=\$(ls ${pname}/target/*.deb); curl -X POST -F file=@\${PLOC} http://localhost:8008/api/files/${pname}-${pversion}" - sh "curl -X POST http://localhost:8008/api/repos/snapshots/file/${pname}-${pversion}" - sh "curl -X PUT -H 'Content-Type: application/json' --data '{}' http://localhost:8008/api/publish/:./trusty" - sh "rm ${pname}/target/*.deb" - sh "rm ${pname}/target/*.changes" -} -- GitLab