Skip to content

Commit 2e78f40

Browse files
eyalbe4eyalbe4
authored andcommitted
Changed documentation link and the "stage" DSL.
1 parent bf37bec commit 2e78f40

File tree

5 files changed

+37
-27
lines changed

5 files changed

+37
-27
lines changed

pipeline-examples/artifactory-generic-upload-download/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
This is a simple demonstration of how to download dependencies, upload artifacts and publish build info to Artifactory.
44
<br>
5-
Read the full documentation [here](https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+-+Working+With+the+Pipeline+Jenkins+Plugin).
5+
Read the full documentation [here](https://www.jfrog.com/confluence/display/RTF/Working+With+Pipeline+Jobs+in+Jenkins).

pipeline-examples/artifactory-gradle-build/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
This is a simple demonstration of how to run a Gradle build, that resolves dependencies, upload artifacts and publish build info to Artifactory.
44
<br>
5-
Read the full documentation [here](https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+-+Working+With+the+Pipeline+Jenkins+Plugin).
5+
Read the full documentation [here](https://www.jfrog.com/confluence/display/RTF/Working+With+Pipeline+Jobs+in+Jenkins).

pipeline-examples/artifactory-gradle-build/artifactoryGradleBuild.groovy

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@ node {
33
def server = Artifactory.server "SERVER_ID"
44
// Create an Artifactory Gradle instance.
55
def rtGradle = Artifactory.newGradleBuild()
6+
def buildInfo
67

7-
stage 'Clone sources'
8-
git url: 'https://github.com/jfrogdev/project-examples.git'
8+
stage('Clone sources') {
9+
git url: 'https://github.com/jfrogdev/project-examples.git'
10+
}
911

10-
stage 'Artifactory configuration'
11-
// Tool name from Jenkins configuration
12-
rtGradle.tool = "Gradle-2.4"
13-
// Set Artifactory repositories for dependencies resolution and artifacts deployment.
14-
rtGradle.deployer repo:'ext-release-local', server: server
15-
rtGradle.resolver repo:'remote-repos', server: server
12+
stage('Artifactory configuration') {
13+
// Tool name from Jenkins configuration
14+
rtGradle.tool = "Gradle-2.4"
15+
// Set Artifactory repositories for dependencies resolution and artifacts deployment.
16+
rtGradle.deployer repo:'ext-release-local', server: server
17+
rtGradle.resolver repo:'remote-repos', server: server
18+
}
1619

17-
stage 'Gradle build'
18-
def buildInfo = rtGradle.run rootDir: "gradle-examples/4/gradle-example-ci-server/", buildFile: 'build.gradle', tasks: 'clean artifactoryPublish'
20+
stage('Gradle build') {
21+
buildInfo = rtGradle.run rootDir: "gradle-examples/4/gradle-example-ci-server/", buildFile: 'build.gradle', tasks: 'clean artifactoryPublish'
22+
}
1923

20-
stage 'Publish build info'
21-
server.publishBuildInfo buildInfo
24+
stage('Publish build info') {
25+
server.publishBuildInfo buildInfo
26+
}
2227
}

pipeline-examples/artifactory-maven-build/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
This is a simple demonstration of how to run a Maven build, that resolves dependencies, upload artifacts and publish build info to Artifactory.
44
<br>
5-
Read the full documentation [here](https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+-+Working+With+the+Pipeline+Jenkins+Plugin).
5+
Read the full documentation [here](https://www.jfrog.com/confluence/display/RTF/Working+With+Pipeline+Jobs+in+Jenkins).

pipeline-examples/artifactory-maven-build/artifactoryMavenBuild.groovy

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@ node {
33
def server = Artifactory.server "SERVER_ID"
44
// Create an Artifactory Maven instance.
55
def rtMaven = Artifactory.newMavenBuild()
6+
def buildInfo
67

7-
stage 'Clone sources'
8-
git url: 'https://github.com/jfrogdev/project-examples.git'
8+
stage('Clone sources') {
9+
git url: 'https://github.com/jfrogdev/project-examples.git'
10+
}
911

10-
stage 'Artifactory configuration'
11-
// Tool name from Jenkins configuration
12-
rtMaven.tool = "Maven-3.3.9"
13-
// Set Artifactory repositories for dependencies resolution and artifacts deployment.
14-
rtMaven.deployer releaseRepo:'libs-release-local', snapshotRepo:'libs-snapshot-local', server: server
15-
rtMaven.resolver releaseRepo:'libs-release', snapshotRepo:'libs-snapshot', server: server
12+
stage('Artifactory configuration') {
13+
// Tool name from Jenkins configuration
14+
rtMaven.tool = "Maven-3.3.9"
15+
// Set Artifactory repositories for dependencies resolution and artifacts deployment.
16+
rtMaven.deployer releaseRepo:'libs-release-local', snapshotRepo:'libs-snapshot-local', server: server
17+
rtMaven.resolver releaseRepo:'libs-release', snapshotRepo:'libs-snapshot', server: server
18+
}
1619

17-
stage 'Maven build'
18-
def buildInfo = rtMaven.run pom: 'maven-example/pom.xml', goals: 'clean install'
20+
stage('Maven build') {
21+
buildInfo = rtMaven.run pom: 'maven-example/pom.xml', goals: 'clean install'
22+
}
1923

20-
stage 'Publish build info'
21-
server.publishBuildInfo buildInfo
24+
stage('Publish build info') {
25+
server.publishBuildInfo buildInfo
26+
}
2227
}

0 commit comments

Comments
 (0)