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

jenkinsfile added, builds (or will build) develop and master branch, all...

jenkinsfile added, builds (or will build) develop and master branch, all versions including "SNAPSHOT" will be deployed to snapshot aptly and nexus repositories, all versions without "SNAPSHOT" will be deployed to release aptly and nexus repositories (as soon I have created the appropriate jenkins pipeline. testing now...
parent b0f4e670
No related branches found
No related tags found
No related merge requests found
node {
def mvnHome
stage('Preparation') {
git 'git://git.projects.gwdg.de/aggregator.git'
mvnHome = tool 'Maven 3.0.4'
}
stage('Build') {
sh "'${mvnHome}/bin/mvn' verify -Ptextgrid.deb"
}
stage('Publish') {
def pom = readMavenPom file: './pom.xml'
def pName = pom.artifactId
def pVersion = pom.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 ./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 ./target/*.deb"
sh "rm ./target/*.changes"
*/
}
def doDebSnapshot(pname, pversion) {
echo "Publishing Debian package ${pname} for SNAPSHOT version ${pversion}"
/*
sh "PLOC=\$(ls ./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 ./target/*.deb"
sh "rm ./target/*.changes"
*/
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment