Added all commands
This commit is contained in:
24
03-multipleProperties.groovy
Normal file
24
03-multipleProperties.groovy
Normal file
@@ -0,0 +1,24 @@
|
||||
pipeline {
|
||||
agent none
|
||||
parameters {
|
||||
booleanParam(defaultValue: true, description: '', name: 'flag')
|
||||
// TODO: Be prepared to change this to "stringParam" once we're on a new enough core.
|
||||
string(defaultValue: '', description: '', name: 'SOME_STRING')
|
||||
}
|
||||
triggers {
|
||||
cron('@daily')
|
||||
}
|
||||
properties {
|
||||
buildDiscarder(logRotator(numToKeepStr:'1'))
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
stages {
|
||||
stage("foo") {
|
||||
steps {
|
||||
echo "hello"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
20
04-parallelPipeline.groovy
Normal file
20
04-parallelPipeline.groovy
Normal file
@@ -0,0 +1,20 @@
|
||||
pipeline {
|
||||
agent none
|
||||
stages {
|
||||
stage("foo") {
|
||||
steps {
|
||||
parallel(
|
||||
first: {
|
||||
echo "First branch"
|
||||
},
|
||||
second: {
|
||||
echo "Second branch"
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
27
05-environmentInStage.groovy
Normal file
27
05-environmentInStage.groovy
Normal file
@@ -0,0 +1,27 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
FOO = "BAZ"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage("baz") {
|
||||
steps {
|
||||
sh 'echo "FOO is $FOO"'
|
||||
}
|
||||
}
|
||||
stage("bar") {
|
||||
environment {
|
||||
FOO = "BAR"
|
||||
}
|
||||
|
||||
steps {
|
||||
sh 'echo "FOO is $FOO"'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
23
06-basicWhen.groovy
Normal file
23
06-basicWhen.groovy
Normal file
@@ -0,0 +1,23 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage("One") {
|
||||
steps {
|
||||
echo "Hello"
|
||||
}
|
||||
}
|
||||
stage("Two") {
|
||||
when {
|
||||
echo "Should I run?"
|
||||
return true
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
echo "World"
|
||||
echo "Heal it"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
07-Saucelabs-Example.groovy
Normal file
23
07-Saucelabs-Example.groovy
Normal file
@@ -0,0 +1,23 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage("One") {
|
||||
steps {
|
||||
echo "Hello"
|
||||
}
|
||||
}
|
||||
stage("Two") {
|
||||
when {
|
||||
echo "Should I run?"
|
||||
return true
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
echo "World"
|
||||
echo "Heal it"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user