Setting up Tuleap CI/CD Pipeline with Jenkins.

Configure CI/CD pipeline on Tuleap

Today In this article we are going to configure a Jenkins server with Tuleap CI/CD.

1) Installation and Configuration of Tuleap with Git.

Previously We have already covered the Installation and configuration of tuleap with git. refer below link;

https://ittroubleshooter.in/configure-tuleap-setup-git-step-step/

2) Plugin Installation on Jenkins.

Tuleap provide two plugin which are free on the Jenkins plugin marketplace. To install plugin go to “Manage Jenkins” —> “Manage Plugins”.

Install below plugins:
Tuleap Git Branch Source
Tuleap Authentication

 

Once Download and Installation of plugin done, restart your Jenkins server.

3) Setting up Tuleap plugins configuration.

Now we need to associate our Jenkins server with a Tuleap server. Go to “Manage Jenkins” —> “System configuration” and in tuleap section add you tuleap DNS Name.

Note: Jenkins and Tuleap servers must be in https and certificate must be valid.

4) Configure Tuleap Git Branch Source Jenkins plugin.

First, We need access key to access our repositories. To create access key, go in Tuleap “My Account”—> Click oon “Keys & Tokens”.

Generate a new Access Key with both Git and REST scopes.

Once you click on “Generate new key”. Tuleap will generate new access key. Please make sure to copy it, you won’t be able to see it again!

Note: Please make sure to copy it, you won’t be able to see it again!

Now In Jenkins, Create a new job with type “Tuleap Project”.

Once the job created, Click on “Add” button. Select “Project name” —> kind “Tuleap Access Key” —> provide “Access Key” —> give it a descriptive id.

Once the tuleap credential is saved, select it in the “Credentials” dropdown. In the Project Section, select the tuleap project which you want to Configured with jenkins.

On “Behaviours” Section, you can adjust the options which you needs. We adjust some fields as shown below and rest of the things are defaults.

On Project Recognises section,  We mentioned the checkout file name i.e “Jenkinsfile”

Note: Every git repository created in Tuleap will be automatically discovered by Jenkins, branches will be inspected to find “Jenkinsfile” and created corresponding pipelines.

Sample Jenkinsfile:

node{

stage('GitLab') {
git branch: 'master',
credentialsId: 'Github-tuleap',
url: 'https://alm.ittroubleshooter.in/plugins/git/software-development/learns-app-cicd.git'
}
stage('List'){
sh 'echo "Hello IT Troubleshooter"'
sh '''
echo "Multiline shell steps works too"
ls -lah
'''
}
}

Rest of the Configuration of job.

Once you apply and save it. This will trigger a scan of our project to look for git repositories, their branches and Jenkinsfile to create Jenkins jobs, refer below screenshot.

 

Once the scan is completed, you will find  the git repositories where Jenkins found a Jenkinsfile and the status of the builds that were triggered.

5) Mention jenkins Server in Tuleap.

We need to inform git server where is the Jenkins server. So add Jenkins instance (i.e https://pipeline.ittroubleshooter.in) in Webhook tab.

6) Check ci/cd service in tuleap.

Now try to commit code from your local machine. tuleap will auto trigger the build for your job.

# git add .
# git commit -m "Add new files"
[master 28d5411] Add new files2
1 file changed, 1 insertion(+), 1 deletion(-)
# git push -u origin master

You Can Verify Jenkins Logs, the auto trigger or not;

2020-07-28 17:02:11.185+0000 [id=456] INFO i.j.p.t.d.impl.DefaultClient#allBranches: GET https://alm.ittroubleshooter.in/api/git/1/branches?offset=0&limit=50
2020-07-28 17:02:14.239+0000 [id=480] INFO o.j.p.workflow.job.WorkflowRun#finish: CI-CD Sample Job/learns-app-cicd/master #3 completed: SUCCESS

you can see a build stage with all the Events associated with your Job.

Hope this post will help Devops beginners. Please share you feedback and Comments. Stay tune for more updates with ittroubleshooter.in …!!!

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of