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

Jenkinsfile added.

parent 8c453ce5
No related branches found
No related tags found
No related merge requests found
node {
def mvnHome
stage('Preparation') {
git 'git://git.projects.gwdg.de/oai-pmh.git'
mvnHome = tool 'Maven 3.0.4'
}
stage('Build') {
sh "'${mvnHome}/bin/mvn' -U clean verify deploy -Pdhrep.deb"
}
stage('Publish') {
def pom = readMavenPom file: 'oaipmh-webapp/pom.xml'
def pName = pom.artifactId
def pVersion = pom.parent.version
def snapshot = pVersion.contains("SNAPSHOT")
if (snapshot) {
doDebSnapshot(pName, pVersion)
} else {
doDebRelease(pName, pVersion)
}
}
}
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