Difference between revisions of "Jenkins and Gitlab integration"

From ETSI Forge
Jump to: navigation, search
 
Line 1: Line 1:
= Jenkins job configuration =
+
=== Jenkins job configuration ===
 
 
 
# Create Jenkins job
 
# Create Jenkins job
 
# Set up permissions
 
# Set up permissions
Line 13: Line 12:
 
[[File:J-post.png|center|thumb]]
 
[[File:J-post.png|center|thumb]]
  
= Gitlab project configuration =
+
=== Gitlab project configuration ===
 
 
 
# Navigate to the project Integrations settings (e.g. [https://forge.etsi.org/gitlab/etsi-cti-admin/test-repo/settings/integrations])
 
# Navigate to the project Integrations settings (e.g. [https://forge.etsi.org/gitlab/etsi-cti-admin/test-repo/settings/integrations])
 
# Insert the link generated by the Gitlab Plugin in Jenkins as the webhook uri
 
# Insert the link generated by the Gitlab Plugin in Jenkins as the webhook uri
 
# Set the secret token
 
# Set the secret token
 
# click test and select "Push"
 
# click test and select "Push"
 +
 +
=== Debug build results ===
 +
 +
To investigate the results of a build in Gitlab, visit the page of a commit (or of a Merge Request) and click on the stage icon, as in the figure below:
 +
[[File:Check-build.png|center|thumb|To check the results of the build, click on the Icon next to "stage", then click on the "jenkins" step.]]
 +
Once in Jenkins, you can access the console output in the menu on the left
 +
[[File:Check-build-2.png|center|thumb]]

Latest revision as of 16:55, 4 October 2018

Jenkins job configuration

  1. Create Jenkins job
  2. Set up permissions
J-permissions.png
  1. Set up Git information
J-git.png
  1. Set up the trigger
J-trigger.png
    • Remember to take note of the link to be used as a hook
    • Important: Click on advanced and generate a secure token to be used in Gitlab
  1. Set up post build actions
J-post.png

Gitlab project configuration

  1. Navigate to the project Integrations settings (e.g. [1])
  2. Insert the link generated by the Gitlab Plugin in Jenkins as the webhook uri
  3. Set the secret token
  4. click test and select "Push"

Debug build results

To investigate the results of a build in Gitlab, visit the page of a commit (or of a Merge Request) and click on the stage icon, as in the figure below:

To check the results of the build, click on the Icon next to "stage", then click on the "jenkins" step.

Once in Jenkins, you can access the console output in the menu on the left

Check-build-2.png