-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Jenkinsfile
40 lines (31 loc) · 1.26 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
node {
stage 'Build'
git url: 'https://github.com/jfrogdev/project-examples.git'
// Get Artifactory server instance, defined in the Artifactory Plugin administration page.
def server = Artifactory.server SERVER_ID
// Create the upload spec.
def uploadSpec = readFile 'jenkins-pipeline-examples/resources/props-upload.json'
// Upload to Artifactory.
def buildInfo = server.upload spec: uploadSpec
// Create the download spec.
def downloadSpec = readFile 'jenkins-pipeline-examples/resources/props-download.json'
// Download from Artifactory.
server.download spec: downloadSpec, buildInfo: buildInfo
// Publish the build to Artifactory
server.publishBuildInfo buildInfo
stage 'Promotion'
def promotionConfig = [
//Mandatory parameters
'buildName' : buildInfo.name,
'buildNumber' : buildInfo.number,
'targetRepo' : 'libs-release-local',
//Optional parameters
'comment' : 'this is the promotion comment',
'sourceRepo' : 'libs-snapshot-local',
'status' : 'Released',
'includeDependencies': true,
'copy' : true
]
// Promote build
server.promote promotionConfig
}