From 893122e1117f324c149d35a09e8e585d67d62ac4 Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Tue, 10 Jan 2017 17:22:51 +0100 Subject: [PATCH] Moved hal to Jenkins pipeline --- Jenkinsfile | 43 +++++++++++++++++++++++++++++++++++++++++++ build.xml | 40 ++++++++++++++++++++-------------------- 2 files changed, 63 insertions(+), 20 deletions(-) create mode 100755 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100755 index 00000000..04f94775 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,43 @@ +// Jenkinsfile (Pipeline Script) +node { + // Configure environment + env.JAVA_HOME = tool name: 'JDK8' + env.REPO_URL = "repo.koc.se/hal.git" //scm.getUserRemoteConfigs()[0].getUrl() + env.BUILD_NAME = "BUILD-" + env.BUILD_ID + + + checkout scm + + stage('Build') { + sh 'ant clean' + sh 'ant build' + } + + stage('Test') { + try { + sh 'ant test' + } finally { + step([$class: 'JUnitResultArchiver', testResults: 'build/reports/*.xml']) + } + } + + + stage('Package') { + sh 'ant package' + archiveArtifacts artifacts: 'build/release/*', fingerprint: true + + // Tag artifact + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'f8e5f6c6-4adb-4ab2-bb5d-1c8535dff491', + usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { + sh "git tag ${env.BUILD_NAME}" + sh "git push 'https://${USERNAME}:${PASSWORD}@${env.REPO_URL}' ${env.BUILD_NAME}" + } + } +} + +//stage('Deploy') { +// input message: 'Deploy?', submitter: 'ziver' +// node { +// sh 'ant deploy' +// } +//} diff --git a/build.xml b/build.xml index 959a0059..d9ba5305 100755 --- a/build.xml +++ b/build.xml @@ -8,13 +8,13 @@ - - - - - + + + + + - + @@ -37,7 +37,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -74,22 +74,11 @@ - + - - - - - - - - - - @@ -122,6 +111,17 @@ + + + + + + + + + +