-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.nano.hpitug
109 lines (108 loc) · 4.89 KB
/
Jenkinsfile.nano.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* Nano Pipeline for TNS/E - requires the tarball, not git. */
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '2'))
}
triggers {
pollSCM('H H * * *')
}
stages {
stage('unpack') {
steps {
withEnv(['NANO_VERSION=5.2',
'DOWNLOADS=/home/downloads']){
cleanWs()
sh 'tar xzf ${DOWNLOADS}/nano-${NANO_VERSION}.tar.gz'
sh 'mv nano-${NANO_VERSION}/* .'
}
}
}
stage('config') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib']) {
sh 'CFLAGS="-c99" CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED=1 -I/usr/local/include/ncurses" conf_script_floss_cc --prefix=/usr/local --enable-utf8'
}
}
}
stage('patch') {
steps {
sh 'sed "/#include <string.h>/a#include <strings.h>" --in-place src/chars.c'
sh 'sed "/#include <unistd.h>/a#include <strings.h>" --in-place src/files.c'
sh 'sed "/#include <unistd.h>/a#include <netdb.h>" --in-place src/files.c'
sh 'sed "/SA_RESETHAND/d" --in-place src/nano.c'
sh 'sed "/tv_nsec == /d" --in-place src/text.c'
sh 'sed "/st_mtim.tv_sec == /s/&& /) {/" --in-place src/text.c'
sh 'sed "/st_mtim.tv_sec == /s/st_mtim.tv_sec/st_mtime/" --in-place src/text.c'
sh 'sed "/timestamp_sec = /s/(long)fileinfo.st_mtim.tv_sec/(long)fileinfo.st_mtime/" --in-place src/text.c'
sh 'sed "/timestamp_nsec = /s/(long)fileinfo.st_mtim.tv_nsec/0/" --in-place src/text.c'
sh 'sed "/(long)fileinfo.st_mtime == timestamp_sec &&/s/(long)fileinfo.st_mtime == timestamp_sec &&/(long)fileinfo.st_mtime == timestamp_sec) {/" --in-place src/text.c'
}
}
stage('build') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib']) {
sh 'make'
}
}
}
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 "Probably fails but that is probably ok"'
}
}
}
stage('test') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib']) {
sh 'make check || echo "Tests failed but expected"'
}
}
}
stage('deploy_src') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib',
'BASENAME=nano',
'DEST=/web/stage']) {
sh '. "${WORKSPACE}/../Ituglib_Build/dist.info" && \
tar cvzf "${DEST}/${BASENAME}-${VERSION}-src.tar.gz" \
--exclude="*.o" \
--exclude="*.a" \
--exclude="*.so" \
--exclude=".git*" \
--exclude="./.git/*" \
.'
}
}
}
stage('install') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib']) {
sh 'make install DESTDIR=${WORKSPACE}/install'
}
}
}
stage('deploy') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib',
'BASENAME=nano',
'DEST=/web/stage']) {
sh 'export INSTALL_LOCATION="${WORKSPACE}/install/usr/local" && export VERSION_PATH="${INSTALL_LOCATION}/bin/nano" && . ${WORKSPACE}/../Ituglib_Build/dist.info.nse && bash ${WORKSPACE}/../Ituglib_Build/package.bin.nomanifest'
}
}
}
}
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]'
}
}
}