Skip to content
Snippets Groups Projects
Commit 56ac13fd authored by Stefan E. Funk's avatar Stefan E. Funk
Browse files

adapted Jenkinsfile to gitflow workflow

parent 3c0c2cbd
No related branches found
No related tags found
No related merge requests found
......@@ -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"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment