How to create a freestyle project on jenkins with github webhook plugin - tooltwist/documentation GitHub Wiki

For this tutorial assuming that you already have a jenkins server, Git and GitHub plugin installed on jenkins and has an admin access on your project on GitHub.

Step 1:

  • Go to your jenkins server then click on new item.

Step 2:

  • Enter your project name
  • Select on freestyle project
  • Click OK

Step 3:

  • After creating new project navigate to Source Code Management section
  • Click on Git
  • Enter GitHub repository URL
  • Enter Branch

Note: In order for this to work you must need to generate a personal access token in order for jenkins to communicate with your repo.

3.1

  • Click on Personal access token
  • Then click on Generate access token

  • Enter token description
  • Check on repo, this will grant a repo access on this token e.g. push/pull
  • Click Generate Token

  • After generating token, get the generated token and append it to your repo web url

e.g. https://{generated-token}@github.com/twistresources/arbys.git

  • Then paste it on jenkins repository URL

Step 4:

  • Navigate to Build Triggers section
  • Check GITScm polling
  • Then save

Step 5:

  • Go to your project github repository
  • Click on settings
  • Integration & services
  • Add Service
  • Select on GitHub plugin

Step 6:

  • Enter jenkins url
  • Save service