Added all commands

This commit is contained in:
Guillem Hernández Sola
2017-04-03 15:26:42 +02:00
parent 7f27c8c3e6
commit 8f2d4e6205
5 changed files with 117 additions and 0 deletions

View 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"
}
}
}
}

View File

@@ -0,0 +1,20 @@
pipeline {
agent none
stages {
stage("foo") {
steps {
parallel(
first: {
echo "First branch"
},
second: {
echo "Second branch"
}
)
}
}
}
}

View 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
View 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"
}
}
}
}
}

View 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"
}
}
}
}
}