Tuesday, February 15, 2022

SonarQube with GitLab

 Git Release Preparation Steps with SonarQube


1. Create a branch release ( dev branch --> build branch-->release branch) from the build branch of your code.

   mvn archetype:generate # this will ask GAV (I am creating a project name mvnproj)

   cd mvnproj

   git init  

   git status # it should show src and pom.xml file in the untracked area

   git add -A

   git commit -m "master branch is updated"

   git branch dev

   git checkout dev

   git branch build

   git checkout build

   git branch release

2. Install and Configure SonarQube.

    Install SonarQube

3. Add/Modify the changes in the dev branch and update the build and release branch.

  Make the changes in dev branch code and merge the changes to build branch and merge build branch to release branch

  Add sonar dependencies in the release branch code 

4. Analyze the code which is in the release branch with SonarQube (here we need to use Maven Integration with sonarqube).

    Goto SonarQube and check that the release branch code should be in the project list.

5. Once Analysis is done then merge the release branch to the master branch.

    git checkout master

     git merge release

6. For CICD pipeline point of view use Gitlab/Jenkins/Bamboo integration with SonarQube.

Create a Repo in Gitlab

7. Once the Analysis is done then it Git Release closure.


0 comments:

Post a Comment