mirror of
https://github.com/mc1arke/sonarqube-community-branch-plugin.git
synced 2024-11-28 08:58:55 +02:00
a6b6db3f30
Sonarqube 8.9 packages all the core code and dependencies as a single fat JAR, which means plugins can no longer add code to the classpath by dropping JARs into the `lib/common` directory as this directory does not exist. To allow the plugin's classes to be visible to the Compute Engine and Web class-loaders, a Java Agent has been introduced that intentionally leaks the plugin classes to the Sonarqube application, thereby allowing the Core Extension Loaders to continue to see and initialise the relevant extension classes, thereby allowing them to load the plugin's implementation classes into Sonarqube's dependency management system. The Docker files have been updated to remove the copying of the plugin to the legacy directory, and to pass additional environment variable so the agent options are added to the relevant Sonarqube component's command-line arguments. Similarly, the fall-through logic in `PlatformEditionProvider` that had allowed the plugin to force the Compute Engine to believe it was running in Sonarqube developer edition has been removed, with the edition now being hard-coded to `COMMUNITY`, without any way of over-riding it. To overcome this, the agent that's being used to expose the plugin classes to Sonarqube's class-loaders is also altering the `PlatformEditionProvider` class definition during class-loading to force it to return `DEVELOPER` when running inside Compute Engine, so that the branch enforcement checks in Compute Engine pass. As the `GetBinding` action has been moved into Sonarqube Community Edition's core from Developer edition, it no longer needs to be provided by this plugin, and has been removed to prevent is causing conflicts on application startup.
46 lines
1005 B
YAML
46 lines
1005 B
YAML
version: "3.8"
|
|
|
|
services:
|
|
sonarqube:
|
|
depends_on:
|
|
- db
|
|
image: mc1arke/sonarqube-with-community-branch-plugin:${SONARQUBE_VERSION}
|
|
build:
|
|
context: .
|
|
dockerfile: ${DOCKERFILE}
|
|
args:
|
|
SONARQUBE_VERSION: ${SONARQUBE_VERSION}
|
|
PLUGIN_VERSION: ${PLUGIN_VERSION}
|
|
container_name: sonarqube
|
|
ports:
|
|
- 9000:9000
|
|
networks:
|
|
- sonarnet
|
|
environment:
|
|
- SONAR_JDBC_URL=jdbc:postgresql://db:5432/sonar
|
|
- SONAR_JDBC_USERNAME=sonar
|
|
- SONAR_JDBC_PASSWORD=sonar
|
|
volumes:
|
|
- sonarqube_conf:/opt/sonarqube/conf
|
|
- sonarqube_data:/opt/sonarqube/data
|
|
db:
|
|
image: postgres:11
|
|
container_name: postgres
|
|
networks:
|
|
- sonarnet
|
|
environment:
|
|
- POSTGRES_USER=sonar
|
|
- POSTGRES_PASSWORD=sonar
|
|
volumes:
|
|
- postgresql:/var/lib/postgresql
|
|
- postgresql_data:/var/lib/postgresql/data
|
|
|
|
volumes:
|
|
sonarqube_conf:
|
|
sonarqube_data:
|
|
postgresql:
|
|
postgresql_data:
|
|
|
|
networks:
|
|
sonarnet:
|