-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
57 lines (41 loc) · 2.63 KB
/
Copy pathJenkinsfile
File metadata and controls
57 lines (41 loc) · 2.63 KB
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
#!groovy
@Library("jenkins-common@master") _
properties(
[
[
$class: 'jenkins.model.BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '10', artifactNumToKeepStr: '10'],
$class: 'CopyArtifactPermissionProperty', projectNames: '*'
]
]
)
node {
stage "build"
checkout scm
sh "./make.sh"
archive 'pkg/*.zip'
stash includes:"pkg/*.zip", name: "binaries"
}
def prepareEnv() {
unstash 'binaries'
env.WORKSPACE = pwd()
sh "find ${env.WORKSPACE}"
sh 'mkdir -p SPECS SOURCES'
sh "cp pkg/*.zip SOURCES/upsilon-pycommon.zip"
}
def buildRpm(dist) {
deleteDir()
prepareEnv()
sh 'unzip -jo SOURCES/upsilon-pycommon.zip "upsilon-pycommon-*/var/pkg/upsilon-pycommon.spec" "upsilon-pycommon-*/.upsilon-pycommon.rpmmacro" -d SPECS/'
sh "find ${env.WORKSPACE}"
sh "rpmbuild -ba SPECS/upsilon-pycommon.spec --define '_topdir ${env.WORKSPACE}' --define 'dist ${dist}'"
archive 'RPMS/noarch/*.rpm'
}
node {
buildRpm("el7")
}
node {
buildRpm("el6")
}
node {
buildRpm("fedora")
}