-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile.hpitug
84 lines (84 loc) · 3.79 KB
/
Jenkinsfile.hpitug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* Jenkinsfile pipeline for GMake on HPITUG (TNS/E) */
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '2'))
}
triggers {
pollSCM('H H * * *')
}
stages {
stage('checkout') {
steps {
checkout([$class: 'GitSCM',
changelog: true,
poll: true,
branches: [[name: 'main']],
extensions: [
[$class: 'CleanBeforeCheckout'],
[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true,
recursiveSubmodules: true, reference: '', trackingSubmodules: false]],
doGenerateSubmoduleConfigurations: false, extensions: [
[$class: 'CleanCheckout'],
[$class: 'CloneOption', timeout: 120, shallow: false, noTags: false],
[$class: 'CheckoutOption', timeout: 120],
],
userRemoteConfigs: [[url: 'https://github.com/ituglib/gmake']]])
}
}
stage('build') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib']) {
sh "/usr/coreutils/bin/make -f Makefile.NSE.OSS"
sh "/usr/coreutils/bin/make -f Makefile.NSE.OSS GMAKE_EXE=/G/data01/jenkmake/gmake"
}
}
}
stage('findcall_floss') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib']) {
sh 'findcall_floss || echo "Ignoring results"'
}
}
}
stage('test') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib']) {
sh '/usr/coreutils/bin/make -C test TEST_LINT= SHELL=/usr/coreutils/bin/bash'
}
}
}
stage('install') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib',
'BASENAME=gmake',
'DEST=/G/data01/jenkins']) {
sh "/usr/coreutils/bin/make -f Makefile.NSE.OSS GMAKE_EXE=${DEST}/gmake"
}
}
}
stage('deploy') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib',
'BASENAME=gmake',
'MANIFEST_FILE=gmake.bin.list',
'GHOME=/G/data01/jenkins',
'PAK_FILE=gmakepak',
'PAK_LIST=gmakelst',
'DEST=/web/stage']) {
sh 'export INSTALL_LOCATION="${GHOME}/" && export VERSION_PATH="${INSTALL_LOCATION}/gmake" && . ${WORKSPACE}/../Ituglib_Build/dist.info.nse && TESTV=`echo $VERSION | fgrep -e -rc`;if [ "$TESTV" != "" ]; then echo "Development Version Suppressed"; else bash ${WORKSPACE}/../Ituglib_Build/package.bin.pak ${MANIFEST_FILE}; fi'
}
}
}
}
post {
always {
mail bcc: '', body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\nDuration: ${currentBuild.durationString}\nChange: ${currentBuild.changeSets}\n More info at: ${env.BUILD_URL}", cc: '', from: '[email protected]', replyTo: '', subject: "[Jenkins HPITUG] ${currentBuild.currentResult}: job ${env.JOB_NAME}", to: '[email protected]'
}
}
}