33 lines
851 B
Groovy
33 lines
851 B
Groovy
#!groovy
|
|
|
|
// this groovy script is executed by jenkins
|
|
node {
|
|
|
|
def server = Artifactory.server 'project.nes.uni-due.de'
|
|
def mvnBuild = Artifactory.newMavenBuild()
|
|
def mvnInfo
|
|
mvnBuild.tool = 'maven-3.3.9'
|
|
mvnBuild.opts = '-Xmx2048m'
|
|
mvnBuild.deployer server: server, releaseRepo: 'internal-releases', snapshotRepo: 'internal-snapshots', deployArtifacts: false
|
|
|
|
// checkout code from scm
|
|
stage('Checkout') {
|
|
checkout scm
|
|
}
|
|
|
|
// build the source code with release profile
|
|
stage('Build') {
|
|
mvnInfo = mvnBuild.run pom: 'pom.xml', goals: '-Djenkins.build.number=${env.BUILD_NUMBER} -B -U clean install'
|
|
}
|
|
|
|
// deploy the final ear
|
|
stage ('Deploy') {
|
|
if (env.BRANCH_NAME == "master") {
|
|
mvnBuild.deployer.deployArtifacts mvnInfo
|
|
} else {
|
|
echo "Skipping deployment for non-master branch."
|
|
}
|
|
}
|
|
|
|
}
|