-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.libpsl.tcmvns
202 lines (199 loc) · 8.76 KB
/
Jenkinsfile.libpsl.tcmvns
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/*
Paste the rest of this file into a standard Pipeline project to
build/test/stage libpsl NSX standard.
Also set Discard old builds, typically log rotation to 2
Poll SCM something useful, like H/45 2 * * *, remember that this job takes
a long time to clone and checkout.
Whomever the user is running this (a.k.a. Jenkins), must have proper
credentials in NonStop SSH.
*/
def localStaging
def downloadVersion
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '2'))
skipDefaultCheckout()
}
triggers {
pollSCM('H H H * *')
}
stages {
stage('checkout') {
steps {
dir('../Ituglib_Build') {
checkout([$class: 'GitSCM',
branches: [[name: 'main']],
extensions: [
[$class: 'CleanBeforeCheckout']],
doGenerateSubmoduleConfigurations: false, extensions: [
[$class: 'CleanCheckout'],
[$class: 'CloneOption', timeout: 120, shallow: true],
[$class: 'CheckoutOption', timeout: 120],
[$class: 'IgnoreNotifyCommit'],
],
userRemoteConfigs: [[url: 'https://github.com/ituglib/ituglib-build.git']]])
}
}
}
stage('setup') {
steps {
script {
load "../Ituglib_Build/Jenkinsfile.globals.all"
load "../Ituglib_Build/Jenkinsfile.globals.nsx"
localStaging = "${LOCAL_STAGING}"
}
script {
def userInput = input(id: 'userInput', message: 'Build Settings?',
parameters: [
string(defaultValue: '', description: 'libpsl Version', name: 'input'),
])
downloadVersion = userInput
}
}
}
stage('unpack') {
steps {
withEnv(["LIBPSL_VERSION=${downloadVersion}",
'LIBPSL_URL_PREFIX=https://github.com/rockdaboot/libpsl/releases/download',
'DOWNLOADS=/home/jenkinsbuild/downloads']){
cleanWs()
sh 'test -f ${DOWNLOADS}/libpsl-${LIBPSL_VERSION}.tar.gz || curl --insecure -L ${LIBPSL_URL_PREFIX}/${LIBPSL_VERSION}/libpsl-${LIBPSL_VERSION}.tar.gz -o ${DOWNLOADS}/libpsl-${LIBPSL_VERSION}.tar.gz'
sh 'tar xf ${DOWNLOADS}/libpsl-${LIBPSL_VERSION}.tar.gz'
sh 'mv libpsl-${LIBPSL_VERSION}/* .'
}
}
}
stage('patch') {
steps {
sh 'sed "/<ws2tcpip.h>/a #elif defined __TANDEM" -i src/psl.c'
sh 'sed "/defined __TANDEM/a # include <unistd.h>" -i src/psl.c'
sh 'sed "/defined __TANDEM/a # include <netinet/in.h>" -i src/psl.c'
sh 'sed "/defined __TANDEM/a # include <netinet/in6.h>" -i src/psl.c'
sh 'sed "/defined __TANDEM/a # include <netdb.h>" -i src/psl.c'
sh 'sed "/defined __TANDEM/a # include <sys/socket.h>" -i src/psl.c'
sh 'sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-cookie-domain-acceptable.c'
sh 'sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-public-all.c'
sh 'sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-public-builtin.c'
sh 'sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-public.c'
sh 'sed "s/alloca(/(char *)malloc(/g" -i tests/test-registrable-domain.c'
}
}
stage('redate') {
steps {
script {
currentTime = sh(returnStdout: true, script: 'date +%Y%m%d%H%M.%S').trim()
sh(returnStdout: true, script: 'echo Set all files to '+currentTime+' to inhibit aclocal-1.16 requirement')
sh(returnStdout: true, script: 'find . -exec touch -t '+currentTime+' {} ";" || echo Ignore any errors')
}
}
}
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="-Wnowarn=1252,272,734 -I/usr/include -I/usr/local/include" conf_script_floss_cc'
}
}
}
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 "Ignore pthread errors"'
}
}
}
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'
}
}
}
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=libpsl',
"DEST=${localStaging}"]) {
sh 'export INSTALL_LOCATION="${WORKSPACE}/install" && export VERSION_PATH="${INSTALL_LOCATION}/usr/local/bin/psl" && . ${WORKSPACE}/../Ituglib_Build/dist.info.nsx && bash ${WORKSPACE}/../Ituglib_Build/package.bin.nomanifest'
}
}
}
stage('config-64') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=/usr/local/lib']) {
sh 'make clean'
sh 'rm -rf ${WORKSPACE}/install'
sh 'CFLAGS="-c99" CPPFLAGS="-Wlp64 -Wnowarn=1252,272,734 -I/usr/include -I/usr/local/include" LDFLAGS="-Wlp64" conf_script_floss_cc --libdir=/usr/local/lib64 --bindir=/usr/local/bin64'
}
}
}
stage('build-64') {
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-64') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib']) {
sh 'findcall_floss || echo "Ignore pthread errors"'
}
}
}
stage('test-64') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib']) {
sh 'make check'
}
}
}
stage('install-64') {
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-64') {
steps {
withEnv(['PATH=/usr/coreutils/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb',
'_RLD_LIB_PATH=:/usr/local/lib',
'BASENAME=libpsl-64',
"DEST=${localStaging}"]) {
sh 'export INSTALL_LOCATION="${WORKSPACE}/install" && export VERSION_PATH="${INSTALL_LOCATION}/usr/local/bin64/psl" && . ${WORKSPACE}/../Ituglib_Build/dist.info.nsx && 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 TCMVNS] ${currentBuild.currentResult}: job ${env.JOB_NAME}", to: '[email protected]'
}
}
}