Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
themiszamani authored Mar 14, 2022
1 parent a55c0ed commit 3ce7e37
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pipeline {
agent any
options {
checkoutToSubdirectory('nagios-plugins-eudat-b2share')
checkoutToSubdirectory('argo-probe-eudat-b2share')
}
environment {
PROJECT_DIR="nagios-plugins-eudat-b2share"
PROJECT_DIR="argo-probe-eudat-b2share"
GIT_COMMIT=sh(script: "cd ${WORKSPACE}/$PROJECT_DIR && git log -1 --format=\"%H\"",returnStdout: true).trim()
GIT_COMMIT_HASH=sh(script: "cd ${WORKSPACE}/$PROJECT_DIR && git log -1 --format=\"%H\" | cut -c1-7",returnStdout: true).trim()
GIT_COMMIT_DATE=sh(script: "date -d \"\$(cd ${WORKSPACE}/$PROJECT_DIR && git show -s --format=%ci ${GIT_COMMIT_HASH})\" \"+%Y%m%d%H%M%S\"",returnStdout: true).trim()
Expand All @@ -13,27 +13,7 @@ pipeline {
stages {
stage ('Build'){
parallel {
stage ('Build Centos 6') {
agent {
docker {
image 'argo.registry:5000/epel-6-ams'
args '-u jenkins:jenkins'
}
}
steps {
echo 'Building Rpm...'
withCredentials(bindings: [sshUserPrivateKey(credentialsId: 'jenkins-rpm-repo', usernameVariable: 'REPOUSER', \
keyFileVariable: 'REPOKEY')]) {
sh "/home/jenkins/build-rpm.sh -w ${WORKSPACE} -b ${BRANCH_NAME} -d centos6 -p ${PROJECT_DIR} -s ${REPOKEY}"
}
archiveArtifacts artifacts: '**/*.rpm', fingerprint: true
}
post {
always {
cleanWs()
}
}
}

stage ('Build Centos 7') {
agent {
docker {
Expand Down

0 comments on commit 3ce7e37

Please sign in to comment.