lbs-gitea/maptology/master This commit looks good
Added robolectric integration-test framework to android app (needs cleanup). Modified jenkins pipeline script to skip deployment when branch name is not master.
37 lines
938 B
Groovy
37 lines
938 B
Groovy
#!groovy
|
|
|
|
// this groovy script is executed by jenkins
|
|
node {
|
|
|
|
// configure maven path for 3.3.9
|
|
def mvnHome = tool 'Maven 3.3.9'
|
|
|
|
// checkout code from scm
|
|
stage('Checkout') {
|
|
checkout scm
|
|
}
|
|
|
|
// delete target directories
|
|
stage('Clean') {
|
|
sh "${mvnHome}/bin/mvn -B clean"
|
|
}
|
|
|
|
// build the source code
|
|
stage('Build') {
|
|
sh "${mvnHome}/bin/mvn -B verify"
|
|
}
|
|
|
|
// deploy the final ear
|
|
stage ('Deploy') {
|
|
if (env.BRANCH_NAME == "master") {
|
|
withCredentials([sshUserPrivateKey(credentialsId: "729686c1-d1d2-4340-8e35-148feff7d3ec", keyFileVariable: "keyfile")]) {
|
|
sh "scp -i ${keyfile} ear/target/maptology.ear wildfly@srv.nes.uni-due.de:/opt/wildfly-10.1.0.final/standalone/deployments/maptology.ear"
|
|
sh "scp -i ${keyfile} android/app/target/*.apk wildfly@srv.nes.uni-due.de:/opt/android/"
|
|
}
|
|
} else {
|
|
echo "Skipping deployment for non-master branch."
|
|
}
|
|
}
|
|
|
|
}
|