Difference between revisions of "Jenkins Projects (aka Jobs) for GitHub"

From Gcube Wiki
Jump to: navigation, search
(Source Code Management and Poll Triggers)
 
(One intermediate revision by the same user not shown)
Line 22: Line 22:
  
 
That should be enough to try to build the project with a Jenkins job.
 
That should be enough to try to build the project with a Jenkins job.
 +
 +
= Examples =
 +
 +
== Source Code Management and Poll Triggers ==
 +
 +
* set option to "Git",
 +
* provide the URL to your repo (e.g. https://code-repo.d4science.org/gCubeSystem/gxRest.git),
 +
* set the credentials to ''git.gcube'',
 +
* specify ''*/master'' as branch to build,
 +
 +
[[File:JenkinsGitHubSourceCodeManagement.png|1000px]]
 +
 +
In "Build triggers" section:
 +
* check "GitHub hook trigger for GITScm polling"
 +
* check "Poll SCM" option with no schedule defined. This setup basically tells Jenkins to poll your GitHub repo only when requested via the [[GitHub/Jenkins:_Setting_up_Webhooks#Webhook_on_the_GitHub_repository|webhook]].
 +
 +
[[File:JenkinsGitHubBuildTriggers.png|1000px]]
 +
 +
''Back to the [[Continuous_Integration_procedure_(2019) | CI guide]].''
 +
 +
[[Category:Continuous_Integration]]

Latest revision as of 23:29, 30 November 2019

gCube GitHub Project Template

The easiest way to create a new project is to clone the gCubeGitHubProjectTemplate project.

1. In the Jenkins interface (Jenkins interface is available at https://jenkins.d4science.org/), select New Item from the options on the left panel:

Jenkins newItem.png

2. In the new item page, assign a name to the project

3. Scroll down until the bottom of the page and use the last option to create the new item from other existing. Insert gCubeGitHubProjectTemplate as input (it should auto-complete).

Jenkins newItemFromGitHubTemplate.png

and confirm with OK.

4. In the new project page, you need to:

  • uncheck the "Disable this project" checkbox
  • provide the URL to the GitHub repo to build

Jenkins newItemRequiredChanges.png

That should be enough to try to build the project with a Jenkins job.

Examples

Source Code Management and Poll Triggers

JenkinsGitHubSourceCodeManagement.png

In "Build triggers" section:

  • check "GitHub hook trigger for GITScm polling"
  • check "Poll SCM" option with no schedule defined. This setup basically tells Jenkins to poll your GitHub repo only when requested via the webhook.

JenkinsGitHubBuildTriggers.png

Back to the CI guide.