Jenkins - Creating pipeline and configuring Git Webhook for build trigger

For Jenkins Installation, refer: http://blog.rajaravi.com/2019/09/jenkins-installation.html

For Jenkins Pipeline definition, refer: http://blog.rajaravi.com/2019/09/jenkins-pipeline-methods-to-define.html

In this post, you can expect to learn Creating pipeline, Adding Git Webhook, Configuring pipeline build to be triggered automatically whenever code check-in happens in the Git repository

I'm using a sample GitHub repository to explain the software build along with a local Jenkins server for pipeline.

GitHub Repository: https://github.com/rrajaravi/anyserv
Jenkins Server: http://jenkins-server:8080/

Let us look at the Jenkins Pipeline creation for continuous delivery of the software anyserv

  • In Jenkins click on "New Item"
  • Enter an item name, click on "Pipeline" for the item type then click on "OK"
 
  • In Build Triggers, Choose "GitHub hook trigger for GITScm polling"
  • In Pipeline tab, choose "Pipeline script from SCM"
  • After choosing Pipeline script from SCM, choose "Git" in SCM selection. Enter the Repository URL. By default Branch name is "master" and Pipeline script name is "Jenkinsfile", Customize it according to your requirement. Click on "Save"
  • Pipeline is saved now and you can see the Pipeline window. There is no data in the Stage View because the Pipeline has not yet run. Click on Build Now to trigger the software build
  • The build should be successful after few minutes. The Stage View would appear on the screen. Refresh the page to look at the Artifacts generated by the build. You can download the Artifact anyserv2.zip by clicking on it.
  • As of now, we have triggered this software build manually. Let us configure GitHub Webhook to trigger this software build Automatically when ever a check in made to the repository
  • Open the GitHub repository navigate to "Settings" --> "Webhooks" --> Click on "Add webhook"

  • In "Payload URL" - Provide Jenkins URL along with github-webhook/ URI, I.e http://jenkins-server:8080/github-webhook/
          In "Content type" - Choose "application/json"
          In "Which events would you like to trigger this webhook?" - Select "Send me everything"
          then click on "Add Webhook"

  • In Pipeline, Build Triggers - "GitHub hook trigger for GITScm polling" has been already chosen, hence it will allow the build to be triggered by GitHub hook
  • Now performing a commit change in the Git repo would trigger the build automatically
  • "GitHub Hook Log" option is available in the Pipeline window itself to see the Hook Log


By creating the Jenkins pipeline and GitHub Webhook, you can ensure the software build is triggered automatically for new code changes. The latest software is build by the pipeline and ready for usage all the time.

 

Post a Comment

15 Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. I was surfing net and fortunately across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information.
    Gastroenterologist

    ReplyDelete
  3. magnificentincense.com
    24K Monkey Classic Incense 10g
    AK-47 – X10 / PREMIUM
    Bizarro Incense
    Buy Black Mamba Incense Online
    Buy WTF Herbal Incense
    Cloud9 Mad Hatter Incense
    Crazy Monkey Incense
    k2 spray on paper
    k2 paper sheets
    Klimax Potpourri 15xxx Coconut(10g)
    Crazy Monkey Incense
    Cloud9 Mad Hatter Incense
    Buy Purple Diesel Incense Online
    Buy Pure Fire Herbal Incense Online
    Buy Kisha Cole Incense (11g) online
    Buy KUSH HERBAL INCENSE online
    Buy Mind Trip Incense Online
    Buy Platinum XXX Herbal Incense online
    buy Orange Platinum Caution 10G
    Buy OMG HERBAL POTPOURRI 10G online

    ReplyDelete
  4. https://syntheticworldwide.com/
    sales@syntheticworldwide.com

    Buy cheap liquid herbal incense at your best online shop

    ReplyDelete
  5. I read your post and got it quite informative. I couldn't find any knowledge on this matter prior to. I would like to thanks for sharing this article here. microsoft teams support houston tx

    ReplyDelete
  6. Any time you connect with the administrations of an expert, you are basically going into an agreement. Since an agreement is lawfully restricting, you need to guarantee that you are ensured as to legitimate issue. The primary thing you would need to check is that the handyman has a substantial permit.Gas Fitter Gladesville

    ReplyDelete
  7. It is a proficient article that you have shared here about innovex usaI got some unique and valuable information from your article. Thankful to you for sharing this article here.

    ReplyDelete
  8. Cannabis oil is an oleoresin acquired by the extraction of cannabis or hashish.

    ReplyDelete
  9. You have worked nicely with your insights. Lots of valuable data can be taken from your article. Genuinely it is a significant article for us.pipe fitting dealers online

    ReplyDelete



  10. Our online store is one of the best in the supply of rare and high-grade (Mushrooms, Edibles. Psychedelics, and more)with absolute purity. All our products are tested to guarantee potency after production, during distribution and even storage. We ship globally in discreet and undetectable packaging using our network of trusted partners.
    psilosybin mushroom 2022, trusted magic mushroom site 2022,
    cheap liquid lsd, order cheap psychedelic mushroom,
    cheap magic mushroom, super quality shrooms,
    most potent psilocybin mushroom on the market,
    best microdosing mushrooms 2022, Golden teacher mushroom for sale,
    where to buy B+ magic mushroom, buy shrooms online ,
    buy psilocybin mushroom overnight shipping, effective microdosing for ptsd,
    buy mushroom truffles online cash on delivery, buy microdose capsules online 2021,
    magic mushrooms for mental illness for sale,
    buy mushies for anxiety/deppression and ptsd, cheap psilocybin mushroom, shrooms near me,
    where to buy psilocybin mushroom near me, cheap psychedelic mushroom for sale,
    buy caps/buttons cheap, best place to buy magic mushroom,
    buy cheap fungi mushrooms, cheap strong fungus, best quality spores for sale,
    buy mushroom grow kit online, buy fungi shrooms near me, cheapest magic mushrooms online,
    where to buy penis envy online, where to buy mexicanna online, buy microdose capsules online,
    best microdose capsule for sale,
    fungi mushroom for sale, best liquid cultures online, buy spores near me, buy Nirvana mushroom near me,
    buy pajaritos mushrooms near me, psychedelic mushroom near me, buy medicinal mushroom online,
    buy 5-MeO-DMT, buy dmt vape pen online, buy lsd tabs online, buy dmt online, where to buy dmt,
    lsd for sale, buy mushies near me, buy shrooms wholesale price, strong boomers for sale,
    Buy trippy shrooms online, buy penis envy, buy albino A+, buy amazonian cubensis,
    buy psilocybe cubensis, buy blue meanie, buy vietam cubensis, buy z strain shrooms,
    buy boomers cubensis online, buy cubensis buy golden teacher, buy liquid lsd online
    Our quality is the best you can find around and we sell in small/large quantities with guaranteed discreet delivery in good time Shipping




    website...https://megapsilocybin.com/
    call/text..+1(458) 201-6900
    email..sale@megapsilocybin.com

    ReplyDelete
  11. The information in the post you posted here is useful because it contains some of the best information available. Thanks for sharing it. Keep up the good work Plumber in gold coast.

    ReplyDelete