Skip to content

Instantly share code, notes, and snippets.

@gabrielrojasnyc
Created October 18, 2016 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielrojasnyc/ee865350598b5a661174d447c5f22e33 to your computer and use it in GitHub Desktop.
Save gabrielrojasnyc/ee865350598b5a661174d447c5f22e33 to your computer and use it in GitHub Desktop.
echo 'Hello World'
stage "build"
node {
git 'https://github.com/jenkinsci/docker'
bat """
dir
"""
}
stage "test"
node {
git 'https://github.com/jenkinsci/docker'
echo "foo is $foo"
if (foo == 'true') {
echo "foo is true"
bat 'dir'
} else {
echo "foo is false"
bat 'type docker-compose.yml'
}
for (def i = 0; i < 2; i++) {
echo "building… $i"
sleep 1
}
}
stage "package"
echo "step 5"
echo "step 6"
checkpoint 'packaged'
stage concurrency: 2, name: "acceptance-test"
node {
parallel first: {
for (def i = 0; i < 4; i++) {
echo "building main... $i"
sleep 1
}
}, secondBranch: {
for (def i = 0; i < 2; i++) {
echo "building main in parallel ... $i"
sleep 2
}
}
}
node {
parallel first: {
for (def i = 0; i < 4; i++) {
echo "building secondary... $i"
sleep 3
}
}, secondBranch: {
for (def i = 0; i < 2; i++) {
echo "building secondary in parallel ... $i"
}
}
}
checkpoint 'accepted'
stage "deploy"
input message: 'Is it ok to push to server ?', ok: '\'Yes, please do\''
echo "Deploying to server."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment