Skip to content

Latest commit

 

History

History
76 lines (68 loc) · 3.09 KB

README.md

File metadata and controls

76 lines (68 loc) · 3.09 KB

terraform-aws-gitlab-sonarqube

Setup SonarQube

GitLab OAuth

  1. In GitLab
    1. Admin -> Application -> New Application
    2. Create Application
      • Name: arbitral
      • RedirectURL: http://<your_sonarqube_dns>/oauth2/callback/gitlab
      • Checked
        • Trusted
        • Confidential
        • Scopes.api
    3. Copy ApplicationID and Secret
  2. In SonarQube
    1. Administration -> Configuration -> DevOps Platform Integrations -> GitLab
      • GitLab Authentication
        • Enabled: true
        • GitLabURL: http://<your_gitlab_dns>
        • AppliactionID: ApplicationID
        • Secret: Secret
        • Allow userd to sign-up: arbitral
        • Synchronize user groups: arbitral (Fllowing, We assume to set true)
    2. Administration -> Configuration -> Generatl -> Server base URL
      • See Issue
      • Server base URL: http://<your_sonarqube_dns>/
  3. (Optional) Synchronize user groups with GitLab
    1. Create gruop in GitLab ( admin-group )
    2. Administration -> Security -> Groups
    3. Create Gruop: admin-group
    4. Administration -> Security -> GlobalPermissions
    5. Attach permissions

GitLab Integration

  1. In GitLab
    1. Create Machine user
      • sonarqube-user
    2. Create Impersonation Token
      • sonarqube-user-impersonation-token
      • Copy token
  2. SonarQube
    1. Register GitLab
      • register gitlab
      • register gitlab

Project

  1. In GitLab
    1. Create Golang project from template
    2. Create Personal access token and copy token
  2. In SonarQube
    1. Register GitLab Project
      • We see waring because GitLab user soanr-user is not assinged to the project.
      • If you not assign sonar-cube user to the project, SonarQube may create bot user in the project at some time.
    2. Follow instractions
  3. Assign sonar-user to GitLab Project
  4. Automatically CICD is runned
    • Check job is compeleted successfully
    • See SonarCube console
    • Create develop branch and check SonarQube plugin operates normally
  5. You Can see bot in MR