DevOps Automation

DevOps Automation

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#DevOps
 View Only

Integrating IBM DevOps Velocity with Gitlab and Configuring the Deployment pipeline

By ShreyaDilip Dhapke posted Tue November 26, 2024 02:18 PM

  

Integrating IBM DevOps Velocity with Gitlab and Configuring the Deployment pipeline

In today’s fast-paced development environment, using the right tools is key to efficiency and collaboration. GitLab, a popular platform for version control and CI/CD, combined with IBM DevOps Velocity for release and valuestream management, offers a powerful solution for DevOps teams. 

This integration streamlines the process from code commits to deployment, improving efficiency and visibility. In this blog, we’ll show you how to integrate GitLab with IBM DevOps Velocity to orchestrate a seamless deployment pipeline.

Step 1: Prepare Your GitLab Repository

Before diving into integration, ensure you have a GitLab repository set up:

Create a Repository:

First, sign in to your GitLab account and Create a New Repository. If you haven't already created a repository, follow these steps:

  • Once logged in, Navigate to the GitLab dashboard.
  • Click the New Project/Repository button.

 

  • Fill in the project details, such as the project name, visibility (public or private), and initialize with a README (optional).
  • Click Create Project.

Once you have created your project, you can add the pipeline code of the CI/CD pipeline in the Pipeline editor:

For this tutorial, I'll be using an existing project named Velocity-Test-2. You can create a new one if you don't have any repositories yet.

Below is a sample test.gitlab-ci.yml pipeline code that I have used in this blog:

stages:

  - build

  - test

  - deploy

build-job:

  stage: build

  script:

    - echo "Compiling the code..."

    - echo "Compile complete."

deploy-dev:

  stage: deploy

  environment: DEV

  script:

    - echo "Deploying to DEV environment."

  when: manual

deploy-QA:

  stage: deploy

  environment: QA

  script:

    - echo "Deploying to QA environment."

  when: manual

deploy-PROD:

  stage: deploy

  environment: production

  script:

    - echo "Deploying to PROD environment."

  when: manual

Once you have created your GitLab project, the next step is to generate a Personal Access Token. This token will enable IBM DevOps Velocity to securely interact with your GitLab repository by providing the necessary authentication.

Step 2 :Generate Access token

  • To generate access token, navigate to Edit Profile → Access tokens and click on Add a new token
  • Provide the name of the token, expiry date and give it proper permissions and click on create token.
  • Once created, save the token value as you won't be able to access it again.
Step 3: Setup the IBM DevOps Velocity integration with Gitlab
  • Navigate to Settings → Integrations → Available and search for GitLab in the search box.
  • Install the latest GitLab plugin.
  • Once the plugin is installed. Navigate to Integrations → Installed tab and find the installed Gitlab plugin.
  • Now to integrate IBM DevOps Velocity with GitLab we need to add integration.
  • Click on Add Integration and provide the requested details.

In this blog I have provided the below information according to my Gitlab instance.

GitLab integration name: Provide the name for the integration.

URL: Provide the URL of GitLab.

Private token: Provide the access token generated earlier which we have saved from GitLab.

Project Names: Provide the name of your Gitlab project.

Once you have provided the required information click on Add. If the provided details are correct the status of the integration should be online, and the logs should show the build synced.

For Example:

You have now successfully integrated GitLab and DevOps Velocity and the integration page should show as below:
Step 4: Orchestrating a Deployment pipeline in DevOps Velocity

In the Gitlab pipeline we have specified the deployment phases to be manual. In order to automate the deployment and orchestrate it we need to create a deployment pipeline in Velocity.

We need to create a new value stream in DevOps velocity to orchestrate the deployment pipeline.

  •  In the IBM DevOps Velocity Navigate to Value streams and click on Create value stream.
  • You can refer to the Creating value streams section from the documentation to create a new value stream.
  • Once you have created the value stream navigate to Pipelines.

In this blog I have a Value stream named tutorial created where I would be adding the Pipeline.

PRE-REQUISITE NOTE: The Application version should be built successfully in Gitlab before configuring the pipeline in DevOps Velocity.

  • To configure Pipelines click on Add application and select GitLab in the managed by section.
  • Once you select GitLab in the managed by section you will be able to see the applications created in the GitLab under the select your applications section.
  • Select the application you want to add in Velocity and click Save.
  • After adding the application to your pipeline, click on the + icon to include the desired application version for all your environments. From the options provided, select the version of your application that you want to deploy.
  • Click on Deploy icon for the DEV environment.
  • Then select the version and click Deploy.
Once the pipeline build has executed successfully, IBM Velocity will display the build number in the selected environment within the application pipeline. 
For Example 
I have performed the Deploy step for all the environments and you can see the version in the Input being deployed for all the environments.
1 comment
27 views

Permalink

Comments

Wed December 18, 2024 06:42 AM

Very helpful for the learners. 
Well explained with nice screenshots.