diff --git a/templates/sonarqube/0/docker-compose.yml b/templates/sonarqube/0/docker-compose.yml new file mode 100644 index 0000000..fa6b751 --- /dev/null +++ b/templates/sonarqube/0/docker-compose.yml @@ -0,0 +1,48 @@ +sonarqube-data: + image: busybox + net: none + labels: + io.rancher.container.start_once: true + volumes: + - /opt/sonarqube/extensions/plugins + +sonarqube: + image: sonarqube + ports: + - ${http_port}:9000 + links: + - postgres + environment: + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + SONARQUBE_JDBC_USERNAME: ${postgres_user} + SONARQUBE_JDBC_PASSWORD: ${postgres_password} + SONARQUBE_JDBC_URL: jdbc:postgresql://postgres/sonar + labels: + io.rancher.sidekicks: sonarqube-data + volumes_from: + - sonarqube-data + +postgres-data: + image: busybox + net: none + labels: + io.rancher.container.start_once: true + volumes: + - ${postgres_data} + +postgres: + image: postgres:latest + ports: + - ${postgress_port}:5432 + environment: + PGDATA: ${postgres_data} + POSTGRES_DB: ${postgres_db} + POSTGRES_USER: ${postgres_user} + POSTGRES_PASSWORD: ${postgres_password} + tty: true + stdin_open: true + labels: + io.rancher.sidekicks: postgres-data + volumes_from: + - postgres-data diff --git a/templates/sonarqube/0/rancher-compose.yml b/templates/sonarqube/0/rancher-compose.yml new file mode 100644 index 0000000..0174f8d --- /dev/null +++ b/templates/sonarqube/0/rancher-compose.yml @@ -0,0 +1,55 @@ +.catalog: + name: "SonarQube" + version: "v0.0.1" + description: "SonarQube" + uuid: sonarqube-0 + minimum_rancher_version: v0.51.0 + questions: + - variable: http_port + description: "HTTP port to access SonarQube UI" + label: "SonarQube HTTP Port" + required: true + default: "9000" + type: "int" + - variable: postgress_port + description: "Port for Postgres" + label: "Postgres Port" + required: true + default: "5432" + type: "int" + - variable: postgres_data + description: "Postgres Data Folder" + label: "Postgres Data" + required: true + default: "/var/lib/postgresql/data/pgdata" + type: "string" + - variable: postgres_db + description: "Postgres Database" + label: "Postgres Database" + required: true + default: "sonar" + type: "string" + - variable: postgres_user + description: "Postgres User" + label: "Postgres User" + required: true + default: "sonar" + type: "string" + - variable: postgres_password + description: "Postgres Password" + label: "Postgres Password" + required: true + default: "sonar" + type: "string" + - variable: http_proxy + description: "In case you are at corporate network, setup http_proxy variable" + label: "http_proxy" + required: false + default: "" + type: "string" + - variable: https_proxy + description: "In case you are at corporate network, setup https_proxy variable" + label: "https_proxy" + required: false + default: "" + type: "string" diff --git a/templates/sonarqube/README.md b/templates/sonarqube/README.md new file mode 100644 index 0000000..51c1041 --- /dev/null +++ b/templates/sonarqube/README.md @@ -0,0 +1,17 @@ +## What is inside SonarQube Stack? +* [SonarQube Server](http://www.sonarqube.org/) + Sidekick for storing plugins +* Postgres Database + Sidekick for storing data + +## Info +* In default SonarQube stack will create "sonar" postgres database with sonar user. +* Additional variables `http_proxy` and `https_proxy` are included, which can be helpfull in some cases. +* Once SonarQube will start, make sure you setup correct information in setup page. +* For easy upgrades there are sidekicks for both postgress and SonarQube with dedicated storage. + +## Installing Plugins Manually +* Go to [Plugin Library](http://docs.sonarqube.org/display/PLUG/Plugin+Library) and find your favourite plugins +* Execute `docker exec -it [sonarqube-data bash]`, go to /opt/sonarqube/extensions/plugins and put your plugins here +* Restart SonarQube container. + +## First Start +* Use admin/admin to login to the SonarQube interface. diff --git a/templates/sonarqube/catalogIcon-sonarqube.png b/templates/sonarqube/catalogIcon-sonarqube.png new file mode 100644 index 0000000..561a879 Binary files /dev/null and b/templates/sonarqube/catalogIcon-sonarqube.png differ diff --git a/templates/sonarqube/config.yml b/templates/sonarqube/config.yml new file mode 100644 index 0000000..ccd4ad5 --- /dev/null +++ b/templates/sonarqube/config.yml @@ -0,0 +1,5 @@ +name: SonarQube +description: | + SonarQube - an open source quality management platform. +version: v0.0.1 +category: Test Automation