Skip to content

Commit d4440da

Browse files
authored
Merge pull request #73 from bitwiseman/feature/step-cleanup
Updated class-based meta steps to friendly names
2 parents 3c1e588 + 91cba77 commit d4440da

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// This shows a simple build wrapper example, using the AnsiColorBuildWrapper plugin.
1+
// This shows a simple build wrapper example, using the AnsiColor plugin.
22
node {
3-
// This is the current syntax for invoking a build wrapper, naming the class.
4-
wrap([$class: 'AnsiColorBuildWrapper']) {
3+
// This displays colors using the 'xterm' ansi color map.
4+
ansiColor('xterm') {
55
// Just some echoes to show the ANSI color.
66
stage "\u001B[31mI'm Red\u001B[0m Now not"
77
}
8-
}
8+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Synopsis
22

33
This shows usage of a simple build wrapper, specifically the
4-
AnsiColorBuildWrapper plugin, which adds ANSI coloring to the console output.
5-
4+
AnsiColor plugin, which adds ANSI coloring to the console output.

pipeline-examples/external-workspace-manager/externalWorkspace.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ node('test') {
2727
} finally {
2828
// perform workspace cleanup only if the build have passed
2929
// if the build has failed, the workspace will be kept
30-
step([$class: 'WsCleanup', cleanWhenFailure: false])
30+
cleanWs cleanWhenFailure: false
3131
}
3232
}
3333
}

pipeline-examples/jobs-in-parallel/jobs_in_parallel.groovy

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ for (int i = 0; i < 4; i++) {
1111
branches["branch${i}"] = {
1212
//Parameters:
1313
//param1 : an example string parameter for the triggered job.
14-
//dummy: a parameter used to prevent triggering the job with the same parameters value. this parameter has to accept a different value
15-
//each time the job is triggered.
16-
build job: 'test_jobs', parameters: [[$class: 'StringParameterValue', name: 'param1', value:
17-
'test_param'], [$class: 'StringParameterValue', name:'dummy', value: "${index}"]]
18-
}
14+
//dummy: a parameter used to prevent triggering the job with the same parameters value.
15+
// this parameter has to accept a different value each time the job is triggered.
16+
build job: 'freestyle', parameters: [
17+
string(name: 'param1', value:'test_param'),
18+
string(name:'dummy', value: "${index}")]
19+
}
1920
}
2021
parallel branches

pipeline-examples/push-git-repo/pushGitRepo.Groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
// credentialsId here is the credentials you have set up in Jenkins for pushing
77
// to that repository using username and password.
8-
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'MyID', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD']]) {
9-
8+
withCredentials([usernamePassword(credentialsId: 'MyID', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
109
sh("git tag -a some_tag -m 'Jenkins'")
1110
sh('git push https://${GIT_USERNAME}:${GIT_PASSWORD}@<REPO> --tags')
1211
}

pipeline-examples/timestamper-wrapper/timestamperWrapper.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This shows a simple build wrapper example, using the Timestamper plugin.
22
node {
3-
// This is the current syntax for invoking a build wrapper, naming the class.
3+
// Adds timestamps to the output logged by steps inside the wrapper.
44
timestamps {
55
// Just some echoes to show the timestamps.
66
stage "First echo"

0 commit comments

Comments
 (0)