-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
86 lines (79 loc) · 2.91 KB
/
Jenkinsfile
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
#! groovy
@Library('gcs-build-scripts') _
def SOURCE_TARBALL_NAME = "8bc3d38c43d80d0910dd04d592a880cf85ef6e4b.tar.gz"
def SOURCE_TARBALL_URL = "https://github.com/SpectraLogic/ds3_c_sdk/archive/${SOURCE_TARBALL_NAME}"
pipeline {
agent none
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
timeout(time: 3, unit: 'HOURS')
}
stages {
stage ("Prepare Source") {
agent any
steps {
checkout scm
script {
env.PACKAGE = "libds3v5"
env.PACKAGE_VERSION = "5.0.0"
env.SOURCE_STASH = "${UUID.randomUUID()}"
dirs (path: env.SOURCE_STASH, clean: true) {
sh """#! /bin/sh
set -e
curl -LOs "${SOURCE_TARBALL_URL}"
cp ../packaging/fedora/libds3v5.spec .
cp -R ../packaging/debian/libds3v5/debian debian
"""
}
stash(name: env.SOURCE_STASH, includes: "${env.SOURCE_STASH}/**/*")
}
}
}
stage ("Build Packages") {
steps {
script {
parallel "debian": {
env.DEB_ARTIFACTS_STASH = buildDebian(
env.SOURCE_STASH,
SOURCE_TARBALL_NAME,
false,
getClubhouseEpic())
}, "rpm": {
env.RPM_ARTIFACTS_STASH = buildMock(
env.SOURCE_STASH,
SOURCE_TARBALL_NAME,
false,
getClubhouseEpic())
}, "failFast": false
}
}
}
stage ("Publish Results") {
agent { label "master" }
steps {
script {
def stashname = "${UUID.randomUUID()}"
dir("artifacts") {
if (env.DEB_ARTIFACTS_STASH) {
unstash(name: env.DEB_ARTIFACTS_STASH)
}
if (env.RPM_ARTIFACTS_STASH) {
unstash(name: env.RPM_ARTIFACTS_STASH)
}
dir("source") {
unstash(name: env.SOURCE_STASH)
sh """rm -rf *.spec debian"""
}
stash(name: stashname, includes: "**/*")
deleteDir()
}
publishResults(
stashname,
env.PACKAGE,
env.PACKAGE_VERSION,
false)
}
}
}
}
}