mc1arke / sonarqube-community-branch-plugin

A plugin that allows branch analysis and pull request decoration in the Community version of Sonarqube
GNU Lesser General Public License v3.0
2.26k stars 526 forks source link

Documentation is not clear on how to install on docker-composed Sonarqube instances #859

Closed KrappRamiro closed 10 months ago

KrappRamiro commented 10 months ago

Hi! Im a newbie developer, and im trying to use your plugin, but i can't understand how to install it.

Im using this docker-compose.yaml for Sonarqube

version: "3"

services:
  sonarqube:
    image: sonarqube:community
    depends_on:
      - db
    environment:
      SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
      SONAR_JDBC_USERNAME: sonar
      SONAR_JDBC_PASSWORD: sonar
    volumes:
      - sonarqube_data:/opt/sonarqube/data
      - sonarqube_extensions:/opt/sonarqube/extensions
      - sonarqube_logs:/opt/sonarqube/logs
    ports:
      - "8087:9000"
  db:
    image: postgres:12
    environment:
      POSTGRES_USER: sonar
      POSTGRES_PASSWORD: sonar
    volumes:
      - postgresql:/var/lib/postgresql
      - postgresql_data:/var/lib/postgresql/data

volumes:
  sonarqube_data:
  sonarqube_extensions:
  sonarqube_logs:
  postgresql:
  postgresql_data:

I have 3 options

  1. Copying the .jar file into the sonarqube_extension volumes
  2. Use the Dockerfile provided (i dont get how, I'm supposed to modify my docker-compose ?)
  3. Use the docker-compose provided (i dont get how also)

I dont understand which one i should use in my case.

Thanks!

brother commented 10 months ago

Use the Dockerfile provided (i dont get how, I'm supposed to modify my docker-compose ?)

place above document in docker-compose.yml, and execute docker-compose pull followed by docker-compose up -d and wait for the start up process to finish. this will give you a sonarqube setup to use.

Copying the .jar file into the sonarqube_extension volumes

the jar file for the plugin must be placed in the host systems plugin volume, it is probbly located under /var/lib/docker/volumes/ if you are using a standard linux box. In my case I have the jar file at /var/lib/docker/volumes/sonarqube_sonarqube_extensions/_data/plugins/.

If my memory serves me correct that is all you need to do. Try and report back. It was a couple of years since I did my initial setup.

KrappRamiro commented 10 months ago

Im so dumb, i never thought of just cloning the repo and doing docker-compose up. Problem solved