-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ARGOeu/devel
Version 0.5
- Loading branch information
Showing
2 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
pipeline { | ||
agent any | ||
options { | ||
checkoutToSubdirectory('nagios-plugins-eudat-b2share') | ||
} | ||
environment { | ||
PROJECT_DIR="nagios-plugins-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() | ||
|
||
} | ||
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 { | ||
image 'argo.registry:5000/epel-7-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 centos7 -p ${PROJECT_DIR} -s ${REPOKEY}" | ||
} | ||
archiveArtifacts artifacts: '**/*.rpm', fingerprint: true | ||
} | ||
post { | ||
always { | ||
cleanWs() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
cleanWs() | ||
} | ||
success { | ||
script{ | ||
if ( env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'devel' ) { | ||
slackSend( message: ":rocket: New version for <$BUILD_URL|$PROJECT_DIR>:$BRANCH_NAME Job: $JOB_NAME !") | ||
} | ||
} | ||
} | ||
failure { | ||
script{ | ||
if ( env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'devel' ) { | ||
slackSend( message: ":rain_cloud: Build Failed for <$BUILD_URL|$PROJECT_DIR>:$BRANCH_NAME Job: $JOB_NAME") | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,8 @@ Packager: Themis Zamani <[email protected]> | |
Source: %{name}-%{version}.tar.gz | ||
BuildArch: noarch | ||
BuildRoot: %{_tmppath}/%{name}-%{version} | ||
AutoReqProv: no | ||
AutoReqProv: no | ||
Requires: python-requests, python2-jsonschema, python-enum34 | ||
|
||
%description | ||
Nagios probe to check functionality of B2SHARE service | ||
|