Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D digitec-wiki
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Digitec
  • digitec-wiki
  • Wiki
  • jenkins

Last edited by Rene Cabral Oct 27, 2014
Page history
This is an old version of this page. You can view the most recent version or browse the history.

jenkins

Create a Jenkins Job

Creating a Jenkins job for your Gitlab project can be broken into 3 major steps:

  • Configure New Jenkins Job
  • Configure Gitlab Project
  • Add Status Badge to Project

For the workflow below, we will reference the KD / kd-ui project as an example

Configure New Jenkins Job

  1. Go to http://ci.digitec.local
  2. Click New Job in the left sidebar
  3. Put your (Gitlab) project name as the job name - e.g. kd-ui
  4. Choose Build a free-style software project
  5. Click OK button
  6. Configure Source Code Management
    1. Select Git
    2. Enter your repository URL - e.g. git@vc.digitec.local:kd/kd-ui.git
    3. Credentials: jenkins
    4. Repository browser: gitlab
    5. Then enter your Gitlab URL - e.g. https://vc.digitec.local/kd/kd-ui/
    6. Grab the Gitlab version from Gitlab Admin Area and enter it in the Version text input - e.g. 6.4.3
  7. Under Build Triggers, enable Poll SCM
  8. Configure the Build section. This varies per project. The following is the build for the kd-ui project
    1. From Add Build Step dropdown, chhose Execute Shell
    2. Commands:
      • npm install
      • grunt jenkins
  9. Under Post-build Actions, choose E-mail Notification from the dropdown
    • Enable both checkboxes, and make any other modifications you see fit
  10. Click Save button
  11. Click Build Now from the sidebar on the left to confirm that your build runs successfully

Configure Gitlab Project

  1. Go to the Settings section of your Gitlab project - e.g. https://vc.digitec.local/kd/kd-ui-docs/edit
  2. Choose the Web Hooks link from the left sidebar
  3. Enter http://ci.digitec.local/git/notifyCommit?url={GIT PROJECT SSH URL}, where {GIT PROJECT SSH URL} is the SSH URL for your Gitlab project - e.g. git@vc.digitec.local:kd/kd-ui.git
  4. Enable the Push events trigger, and click Add Web Hook
  5. The Test Hook functionality doesn't appear to be working at the time of this writing, push a change to your Gitlab repository and then check your Jenkins job to verify that it was triggered.

Add Status Badge to Project

Add a Jenkins status badge to your project's README.md file, beneath the title, in the following format

[![Jenkins]({JENKINS JOB URL}/badge/icon)]({JENKINS JOB URL})

Where {JENKINS JOB URL} is the URL to your Jenkins job - e.g:

[![Jenkins](http://ci.digitec.local/job/kd-ui/badge/icon)](http://ci.digitec.local/job/kd-ui/)
Clone repository
  • alpha beta testing
  • browser testing
  • camtasia licenses
  • code delivery processes
  • coding practices
  • css and sass coding standards
  • database schema standards
  • dependency management
  • development environments
  • digitec agile process
  • digitec gitlab styles
  • digitec software promises
  • digitec spec process
  • gitlab administration
  • gitlab issues tags
View All Pages