Showing posts with label webhook. Show all posts
Showing posts with label webhook. Show all posts

Friday, 4 March 2022

How to configure Webhooks for Pipeline(Terraform)

 Create a Pipeline in jenkins for your terraform automation

  • Go to Jenkins > New Items. Enter terraform-pipeline in name field > Choose Pipeline > Click OK


  • Select Configure after creation.
  • Go to Build Triggers and enable Trigger builds remotely.
  • Enter tf_token as Authentication Token

 









Now Save

Next 

Bitbucket Changes

    • Create a new Bitbucket Repo and call it terraform-pipeline
    • Go to Repository Settings after creation and select Webhooks
    • Click Add Webhooks
    • Enter tf_token as the Title
    • Copy and paste the url as shown below
              http://JENKINS_URL:8080/job/terraform-pipeline/buildWithParameters?token=tf_token
    • Status should be active
    • Click on skip certificate verification
    • triggers --> repository push
Now Whenever you push changes, to bitbucket , it will trigger the pipeline

Tuesday, 1 September 2020

How to configure webhooks in Bitbucket to trigger a build in Jenkins? How to trigger automated builds in Jenkins through Bitbucket

 

Jenkins jobs can be triggered many ways. Here are those ways:


1. pull - using poll scm
2. Webhooks (push mechanism) - by triggering a build from Bitbucket or GitHub for every repository changes.
3. through slack channel. We will cover this in a later class.
 

Webhooks are triggers that enables developers to trigger Jenkins jobs automatically every time there is a code change

we will see in this article how to trigger a(push) build for every change in bitbucket repository:

Changes needed in Jenkins


1. Install the Bitbucket Plugin:

Go tom Manage Jenkins---Plugin Manager

Search Bitbucket and install without restart


Select the job you would like to configure webhook is for. 

Choose configure 

Click on the build job. 

Go to triggers section and click on Build When a change is Pushed to Bitbucket


Also uncheck poll SCM option(if it was selected earlier)



Changes in Bitbucket

1. go to bitbucket, choose the repository, go to settings, click on web hooks.



2. enter title, url which is your jenkins job url - append b
 example the url should be like this - http://jenkins_public_dns_server_url:8080/bitbucket-hook/

Sample url is given below:

http://jenkins_url:8080/bitbucket-hook/

3. status should be active
4. click on skip certificate verification
5. triggers --> repository push

Now make a code change in bitbucket to see if that triggers a build in Jenkins automatically.


How to upgrade Maven

  java.lang.IllegalStateException I had installed maven in my ubuntu using command  apt install maven This installed maven in path /usr/shar...