-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Jenkinsfile
23 lines (18 loc) · 944 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
node {
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
def buildInfo = Artifactory.newBuildInfo()
// Set custom build name and number.
buildInfo.setName 'holyFrog'
buildInfo.setNumber '42'
// Read the upload spec which was downloaded from github.
def uploadSpec = readFile 'jenkins-pipeline-examples/resources/recursive-flat-upload.json'
// Upload to Artifactory.
server.upload spec: uploadSpec, buildInfo: buildInfo
// The download file contains pattern for downloading artifacts to the root directory by setting recursive=false
def downloadSpec = readFile 'jenkins-pipeline-examples/resources/aql-download.json'
server.download spec: downloadSpec, buildInfo: buildInfo
// Publish build info.
server.publishBuildInfo buildInfo
}