Atlassian provides various product for issue tracking, continuous integration and code management which come with the implementation and licensing cost. An organization has to pay a large sum for each product for integration with their products. In order to have pocket-friendly solutions, any organization uses open source applications with similar benefits like Atlassian product without investing money.

This blog illustrates the usage of three open source products and their integration with each other to automate various manual tasks. We will be using Redmine, Gitlab and Jenkins for issue tracking, git repository manager and continuous integration respectively.

To implement this we will be using various integration steps and screenshots that will help us to make this unique combo up and working.

Software Versions:

For our implementation, we will be using the Redmine 3.3.2, GitlabCE 8.15.4, and Jenkins 2.37.

 

Redmine –  Planning, Tracking and Collaborating

Redmine is a flexible project management web application. Following are some features of Redmine:

  • Multiple projects support
  • Flexible role based access control
  • Flexible issue tracking system
  • Gantt chart and calendar
  • News, documents & files management
  • Feeds & email notifications
  • Per project wiki, forums
  • Time tracking
  • Custom fields for issues, time-entries, projects and users
  • SCM integration (SVN, CVS, Git, Mercurial)
  • Issue creation via email
  • Multiple LDAP authentication support
  • User self-registration support
  • Multiple databases support

Redmine provides team collaboration software known as Wiki which can be used as a single source of information for various projects. Team members from each project may share their code and other information using the project specific wiki page

Gitlab – Version control

GitLab is a web-based Git repository manager with wiki and issue tracking features, using an open source license. Some features of Gitlab

  • free for unlimited private projects
  • setup and manage CI/CD
  • releases a new version each month
  • Flexible permissions for user’s role

Jenkins – CI/CD

Jenkins – Jenkins is a simple, extensible and user-friendly open source tool that provides CI/CD services for application development. Jenkins supports VCS tools such as Subversion, CVS, Git and so on. Jenkins can build Freestyle, Apache Ant, and Apache Maven-based projects. Some features of Jenkins :

  • Easy installation on different operating systems
  • Easy upgrades—Jenkins has very speedy release cycles
  • Simple and easy-to-use user interface
  • Easily extensible with the use of third-party plugins—over 400 plugins
  • Easy to configure the setup environment in the user interface. Customization is possible.
  • The master-slave architecture supports distributed builds to reduce loads on the CI server.
  • Jenkins is available with test harness built around JUnit; test results are available in graphical and tabular forms
  • Build scheduling based on the cron expression
  • Shell and Windows command execution in prebuild steps
  • Notification support related to the build status

Now let’s see integration between all these products.

Atlassian provides a way to integrate one product with another to increase the flexibility of work process and to make work faster and more efficient. We will discuss few integrations, which are proven to be very helpful in development and production environment.

For development and production environment it is very important to process executes faster and more efficiently. These integrations allow team members to stay on top of each issue’s implementation, quality, and release status.

1. Gitlab-Redmine integration

This integration allows a user to view/create an issue from the linked Redmine project.

How to do: To enable the Redmine integration in a project, navigate to the services page, click the Redmine service, and fill in the required details on the page as described in the table below.

Gitlab-Redmine Integration
Fig 1. Gitlab-Redmine Integration

 

2. Jenkins-Gitlab integration

This integration makes Gitlab’s repositories available to Jenkins builds. Also, we can configure the triggers that run Jenkins builds when any changes are pushed onto the linked Gitlab repositories.

How to do: Install Jenkins GitLab Plugin. Go to Manage Jenkins -> Configure System and scroll down to the ‘GitLab’ section. Enter the GitLab server URL in the ‘GitLab host URL’ field and paste the API token copied earlier in the ‘API Token’ field.

 Gitlab-Jenkins Integration
Fig 2. Gitlab-Jenkins Integration

3. Jenkins-Redmine integration

Install Redmine plugin in Jenkins. Go to manage jenkins->configure system and scroll down to the ‘Redmine’ section. Enter the Redmine server URL in ‘Base URL’ field and version number of Redmine.

Jenkins-Redmine Integration
Fig 3. Jenkins-Redmine Integration

Using integrations in the Dev/Prod:

Now that we have an idea about how these products can be integrated with each other, let’s take a look on how these integrations can be used in development as well as in production environment.

For that we have,

1. A project in Gitlab

2. Integration of Jenkins, Redmine, and Gitlab

 Integration Steps
Fig 4. Integration Steps

Follow the below steps :

Step 1: Gitlab project

Create a project in Gitlab or use any existing one project that contains a source code of development environment.

Step 2: Create project in Redmine

Create a new project in Redmine. Go to project section and click on the new project. New page open as shown in fig below. Then click on ‘create’ button.

New project in Redmine
Fig 5. New project in Redmine

 

Step 3: Integration of Gitlab and Redmine

As mentioned already in fig. 1, we need to integrate Redmine and Gitlab. Once integration is successful, a user can create an issue in the linked redmine project or view an existing issue from the linked redmine project using the issues page in GitLab.

Redmine issues
Fig 6. Viewing/Creating Redmine issues via GitLab

 

Next user has to add a ‘Redmine GitLab Hook plugin’ in Redmine. This plugin will be allowing a user to browse users code and view users changesets directly in Redmine. The Redmine GitLab Hook plugin allows GitLab to notify Redmine installation when changes have been pushed to a repository, triggering an update of user’s local repository and Redmine data only when it is actually necessary.

To install ‘Redmine GitLab Hook plugin’ in Redmine follow this link: https://github.com/phlegx/redmine_gitlab_hook

Step 4: Jenkins integration with Gitlab and Redmine

4.1 Jenkins-Gitlab integration

As mentioned in fig. 2 (above), we will now integrate Jenkins and Gitlab. Once integration is successful, a user can view git option under job configuration>source code management area as shown in fig below.

Configure Jenkins job: Add Gitlab repository URL and credentials in source code management of job configuration.

Gitlab repo URL in Jenkins job configuration
Fig 7. Adding Gitlab repo into Jenkins

4.2 Jenkins-Redmine integration

After Jenkins-Redmine integration user will have to configure job by adding following setting

Configure Jenkins job for Redmine: Add Redmine website and Redmine project identifier in job configuration.

Assinging Redmine project into Jenkins
Fig 8. Assigning Redmine project into Jenkins

This will show issue status in Jenkins job as a ‘Ticket Metrics’. This is graphical representation of Redmine issues status

jenkins-redmine-issue
Fig 9. Redmine issue status in Jenkins

Step 5: Project changes and commits on Gitlab

When a developer is working on a project he/she will have to clone the project into their working directory.

Change the current working directory to the location as per user requirements and clone the Gitlab Repo.

Type git clone, and then paste the URL you copied from Gitlab.

git clone <gitlab_project_URL>

Then a user can work on a repository, make some changes into files.

Add the files in user’s local repository. This stages them for the first commit.

git add .

Commit the files that user’s staged in user’s local repository.

git commit -m “First commit”

Push the changes from user’s local repository to Gitlab.

git push

 

Step 6: Gitlab commits trigger Jenkins build

Whenever user/developer commits their changes to the repository, it will trigger the linked Jenkins build automatically.

Fig 10. Gitlab commits

Step 7: Jenkins build status on Gitlab and Redmine

When Jenkins build concludes, it shows the build status on both Gitlab and Redmine along with the Redmine issue number.

Jenkins build status in Gitlab
Fig 11. Jenkins build status in Gitlab

 

In Redmine, a user has to add Jenkins plugin using this link https://github.com/jbox-web/redmine_jenkins.

After adding this plugin to Redmine, a user has to specify Jenkins URL in Redmine linked project. Then the Redmine will display Jenkins job status and build number in Jenkins tab as shown in fig below. Also, a user can build a Jenkins job from Redmine by clicking the ‘Build Now’ button.

Fig 12. Jenkins build status in Redmine

Advantages:

  • Provides traceability and visibility across teams
  • Increase the flexibility of work process
  • Faster execution of tasks and more efficient
  • Provides Continuous Builds to keep everything up to date with changes
  • Open source product

Conclusion: This blog comprises of Integration of various non-Atlassian products such as Redmine-Gitlab-Jenkins which are open source products. Now we can integrate Redmine-Gitlab-Jenkins just like that for free and follow Agile methodology.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


CAPTCHA Image
Reload Image