From f3175e537bac52f51d004aea01d438cd48ba76dc Mon Sep 17 00:00:00 2001 From: pjacewicz Date: Wed, 29 Jul 2020 14:46:13 +0200 Subject: [PATCH] Jenkinsfile added --- jenkins/deploy/Jenkinsfile | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 jenkins/deploy/Jenkinsfile diff --git a/jenkins/deploy/Jenkinsfile b/jenkins/deploy/Jenkinsfile new file mode 100644 index 000000000..9879f6353 --- /dev/null +++ b/jenkins/deploy/Jenkinsfile @@ -0,0 +1,68 @@ +pipeline { + agent any + + options { + buildDiscarder(logRotator(numToKeepStr: "5")) + timeout time: 60, unit: "MINUTES" + } + + stages { + stage("Install") { + steps { + configFileProvider([configFile(fileId: "dnet-hadoop-build.properties", variable: 'BUILD_PROPERTIES')]) { + load "${BUILD_PROPERTIES}" + withEnv(["JAVA_HOME=${ tool type: 'jdk', name: "${JDK_VERSION}" }", + "PATH+MAVEN=${tool type: 'maven', name: "${MAVEN_VERSION}"}/bin:${env.JAVA_HOME}/bin"]) { + sh """ + mvn clean install -DskipTests + """ + } + } + } + } + +// stage("Upload") { +// steps { +// configFileProvider([configFile(fileId: "iis-build-properties", variable: 'BUILD_PROPERTIES')]) { +// load "${BUILD_PROPERTIES}" +// withEnv(["JAVA_HOME=${ tool type: 'jdk', name: "${JDK_VERSION}" }", +// "PATH+MAVEN=${tool type: 'maven', name: "${MAVEN_VERSION}"}/bin:${env.JAVA_HOME}/bin"]) { +// sshagent(['iis-deployment-credentials']) { +// sh """ +// cd iis-wf/iis-wf-primary && \ +// mvn clean package -Poozie-package,deploy \ +// -Dworkflow.source.dir=eu/dnetlib/iis/wf/primary/main \ +// -DiisConnectionProperties=${WORKSPACE}/connection-properties/iis-cdh5-test-gw.properties +// """ +// } +// } +// } +// } +// } + +// stage("Deploy") { +// steps { +// sshagent(['iis-deployment-credentials']) { +// sh """ +// WORKING_DIR=/tmp/jenkins/`date +%Y-%m-%d` && \ +// ssh -o StrictHostKeyChecking=no jenkins@iis-cdh5-test-gw.ocean.icm.edu.pl "\ +// rm -rf \${WORKING_DIR} && \ +// mkdir -p \${WORKING_DIR} +// " && \ +// scp -r ${WORKSPACE}/jenkins/deploy/ jenkins@iis-cdh5-test-gw.ocean.icm.edu.pl:\${WORKING_DIR} && \ +// ssh -o StrictHostKeyChecking=no jenkins@iis-cdh5-test-gw.ocean.icm.edu.pl "\ +// cd \${WORKING_DIR}/deploy && \ +// sh deploy_release.sh +// " +// """ +// } +// } +// } + } + + post { + always { + cleanWs() + } + } +}