Jenkins

Jenkins Configs

1. Sample Pipeline

  • Type pipeline

  • Build Perodically : * * * * * 5 stars for every minute run

  • Pipeline Script

node {
    timestamps{
        stage "code build"
        echo "Stage 1 done"
        
        stage "Testing"
        echo "Testing Completed"
        
        stage "Final"
        echo "sucess"
    }
}

2. Dummy Pipeline SCM

  • Type : Pipeline

  • Pipeline Scripts from SCm

  • Source :Git

  • Source Containing File named Jenkins

node{
  timestamps{
  
  stage "Code Build"
  echo "Stage 1 Done"
  
  stage "Testing"
  echo "Testing Completed"
  
  stage "Final"
  echo "Sucess"
    
  }
}

3 . FreeStyle

  • Type : Freestyle

  • Source : Git repository added

  • Build : Execute Window batch command

Dir

4. MVN Maven Pipeline Projects

  • Install the Maven Build if not have already

  • Type : Maven

  • Source : Github Repo

  • Build Environment :

    • Delete workspace before build starts

    • Add timestamp to console output

  • Pre Steps : Execute windows batch command

echo " Maven Build Started"
  • Build : pom.xml from repo of the maven project

  • Goal and Option : clean test

  • Post Steps : Run Regardless of build result

5. Unit Testing

  • Type : Maven

  • Repo : Github

  • Maven : clean test

  • Post Build Action :

    • Install NUnit plugin in jenkin

    • Publish NUnit test result report

6. JMeter

  • Install JMeter as plugin in the maven

  • Type : Maven

  • Repo : Github

  • Maven : clean test

  • Build : Execute the windows batch command as both are on the same OS (Jenkins + Jmeter)

(Jmeter config command to use the console version of the Jmeter)
  • Post Build Action :

    • Publish Performance test result report

7. TestNg + Maven Project

  • type : Maven

  • Repository : GIt

  • Environment : Delete workspace before build starts

  • Build : clean

  • Post Build : Publish Test Ng results

8. Parametrized Project

  • Freestyle

  • Parameter : Java Parameter

9. Multi Configuration

  • Type : MultiConfiguration

  • Source : Git

Last updated