Skip to content

Instantly share code, notes, and snippets.

@arehmandev
Forked from chinshr/Jenkinsfile
Created April 12, 2017 10:10
Show Gist options
  • Select an option

  • Save arehmandev/d74165760b6bc08fbb6547ee6260f7d8 to your computer and use it in GitHub Desktop.

Select an option

Save arehmandev/d74165760b6bc08fbb6547ee6260f7d8 to your computer and use it in GitHub Desktop.

Revisions

  1. @chinshr chinshr revised this gist Sep 17, 2015. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion Jenkinsfile
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,5 @@
    #!groovy
    # Best of Jenkinsfile
    # `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
    # `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
    node {
    }
  2. @chinshr chinshr revised this gist Sep 11, 2015. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions parallel-stage-2.groovy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    stage "unit test"

    node {
    git "[email protected]:michaelneale/oaks-trail-ride.git"
    sh "echo unit test app"
    }

    stage "test on supported OSes"

    parallel (
    windows: { node {
    sh "echo building on windows now"

    }},
    mac: { node {
    sh "echo building on mac now"
    }}
  3. @chinshr chinshr revised this gist Sep 11, 2015. 1 changed file with 20 additions and 0 deletions.
    20 changes: 20 additions & 0 deletions parallel-stage.groovy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    node {
    for (int i=0; i< 2; ++i) {
    stage "Stage #"+i
    print 'Hello, world $i!'
    }

    stage "Stage Parallel"
    def branches = [:]
    for (int i = 0; i < numHelloMessages.toInteger(); i++) {
    branches["split${i}"] = {
    stage "Stage parallel- #"+i
    node('remote') {
    echo 'Starting sleep'
    sleep 10
    echo 'Finished sleep'
    }
    }
    }
    parallel branches
    }
  4. @chinshr chinshr revised this gist Sep 10, 2015. No changes.
  5. @chinshr chinshr revised this gist Sep 10, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Jenkinsfile
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    # Jenkinsfile
    # Best of Jenkinsfile
    # `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
  6. @chinshr chinshr revised this gist Sep 10, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Jenkinsfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    # Jenkinsfile
  7. @chinshr chinshr revised this gist Sep 10, 2015. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
  8. @chinshr chinshr renamed this gist Sep 10, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. @chinshr chinshr revised this gist Sep 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Jenkinsfile.mvn-build-and-test
    Original file line number Diff line number Diff line change
    @@ -6,5 +6,5 @@ node {
    def mvnHome = tool 'M3'
    sh "${mvnHome}/bin/mvn -B -Dmaven.test.failure.ignore verify"
    step([$class: 'JUnitResultArchiver', testResults:
    '**/target/surefire-reports/TEST-*.xml'])
    '**/target/foobar/TEST-*.xml'])
    }
  10. @chinshr chinshr revised this gist Sep 10, 2015. 2 changed files with 4 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Jenkinsfile.mvn-build-and-test
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    # Jenkinsfile
    # Build and test a Maven project

    node {
    git url: 'https://github.com/user/repo.git'
    def mvnHome = tool 'M3'
    2 changes: 2 additions & 0 deletions Jenkinsfile.mvn-verify
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    # Jenkinsfile
    # Verify a Maven project

    node {
    git url: 'https://github.com/user/repo.git'
    def mvnHome = tool 'M3'
  11. @chinshr chinshr revised this gist Sep 10, 2015. 2 changed files with 9 additions and 1 deletion.
    8 changes: 8 additions & 0 deletions Jenkinsfile.mvn-build-and-test
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # Build and test a Maven project
    node {
    git url: 'https://github.com/user/repo.git'
    def mvnHome = tool 'M3'
    sh "${mvnHome}/bin/mvn -B -Dmaven.test.failure.ignore verify"
    step([$class: 'JUnitResultArchiver', testResults:
    '**/target/surefire-reports/TEST-*.xml'])
    }
    2 changes: 1 addition & 1 deletion Jenkinsfile → Jenkinsfile.mvn-verify
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Maven verify
    # Verify a Maven project
    node {
    git url: 'https://github.com/user/repo.git'
    def mvnHome = tool 'M3'
  12. @chinshr chinshr created this gist Sep 10, 2015.
    6 changes: 6 additions & 0 deletions Jenkinsfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # Maven verify
    node {
    git url: 'https://github.com/user/repo.git'
    def mvnHome = tool 'M3'
    sh "${mvnHome}/bin/mvn -B verify"
    }