Skip to content

Commit

Permalink
52 update to sonarqube 10 (#54)
Browse files Browse the repository at this point in the history
* Bump to 10.1.0

* Update plugins and profiles

* Add github action and consolidate Dockerfile
  • Loading branch information
wkoot authored Sep 5, 2023
1 parent c0bc383 commit d486b30
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- run:
shell: /bin/bash
command: |
docker build -f Dockerfile-community-edition -t ictu/sonar:${CIRCLE_TAG} .
docker build -t ictu/sonar:${CIRCLE_TAG} .
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push ictu/sonar:${CIRCLE_TAG}
build_and_push_de_tag:
Expand All @@ -18,7 +18,7 @@ jobs:
- run:
shell: /bin/bash
command: |
docker build -f Dockerfile-developer-edition -t ictu/sonar:${CIRCLE_TAG} .
docker build --build-arg="IMAGE_EDITION=developer" -t ictu/sonar:${CIRCLE_TAG} .
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push ictu/sonar:${CIRCLE_TAG}
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Docker Image CI

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- env:
IMAGE_EDITION: community
- env:
IMAGE_EDITION: developer
steps:
- uses: actions/checkout@v3

- name: Build the Docker image
run: docker build --build-arg="IMAGE_EDITION=${{ matrix.env.IMAGE_EDITION }}" -t ci .

- name: Run the Docker image
run: docker run -d --name ci ci

- name: Verify the Docker image
# profile for language 'web' is the last; assume everything is working if we got this far
run: docker logs -f ci |& sed '/Current profile for language web is Sonar way/ q'
timeout-minutes: 3

- name: Stop the Docker image
run: docker stop ci
5 changes: 4 additions & 1 deletion Dockerfile-community-edition → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM sonarqube:9.9.1-community
ARG IMAGE_NAME=sonarqube
ARG IMAGE_VERSION=10.1.0
ARG IMAGE_EDITION=community
FROM $IMAGE_NAME:$IMAGE_VERSION-$IMAGE_EDITION
USER root
RUN apt-get update && apt-get install -y wget curl ca-certificates-java jq postgresql-client \
&& rm -rf /var/lib/apt/lists/*
Expand Down
17 changes: 0 additions & 17 deletions Dockerfile-developer-edition

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Example docker-compose file:
version: '3.7'
services:
www:
image: ictu/sonar:9.9.1
image: ictu/sonar:10.1.0
environment:
- SONAR_JDBC_URL=jdbc:postgresql://db:5432/sonar
- SONAR_JDBC_USERNAME=sonar
Expand Down
6 changes: 3 additions & 3 deletions plugins/plugin-list
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
https://github.com/checkstyle/sonar-checkstyle/releases/download/10.9.3/checkstyle-sonar-plugin-10.9.3.jar
https://github.com/sbaudoin/sonar-ansible/releases/download/v2.5.1/sonar-ansible-plugin-2.5.1.jar
https://github.com/dependency-check/dependency-check-sonar-plugin/releases/download/3.1.0/sonar-dependency-check-plugin-3.1.0.jar
https://github.com/checkstyle/sonar-checkstyle/releases/download/10.12.3/checkstyle-sonar-plugin-10.12.3.jar
https://github.com/dependency-check/dependency-check-sonar-plugin/releases/download/4.0.0/sonar-dependency-check-plugin-4.0.0.jar
https://github.com/jborgers/sonar-pmd/releases/download/3.4.0/sonar-pmd-plugin-3.4.0.jar
https://github.com/sbaudoin/sonar-yaml/releases/download/v1.7.0/sonar-yaml-plugin-1.7.0.jar
https://github.com/spotbugs/sonar-findbugs/releases/download/4.2.3/sonar-findbugs-plugin-4.2.3.jar
https://github.com/vaulttec/sonar-auth-oidc/releases/download/v2.1.1/sonar-auth-oidc-plugin-2.1.1.jar
https://github.com/sbaudoin/sonar-ansible/releases/download/v2.5.1/sonar-ansible-plugin-2.5.1.jar
18 changes: 9 additions & 9 deletions start-with-profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,14 @@ testAdminCredentials

# (Re-)create the ICTU profiles
RULES_VERSION=20230619
createProfile "ictu-ansible-profile-v2.5.1-${RULES_VERSION}" "Sonar%20way" "yaml"
createProfile "ictu-cs-profile-v8.51.0-${RULES_VERSION}" "Sonar%20way" "cs"
createProfile "ictu-java-profile-v7.16.0-${RULES_VERSION}" "Sonar%20way" "java"
createProfile "ictu-js-profile-v9.13.0-${RULES_VERSION}" "Sonar%20way" "js"
createProfile "ictu-kotlin-profile-v2.12.0-${RULES_VERSION}" "Sonar%20way" "kotlin"
createProfile "ictu-py-profile-v3.24.0-${RULES_VERSION}" "Sonar%20way" "py"
createProfile "ictu-ts-profile-v9.13.0-${RULES_VERSION}" "Sonar%20way" "ts"
createProfile "ictu-vbnet-profile-v8.51.0-${RULES_VERSION}" "Sonar%20way" "vbnet"
createProfile "ictu-web-profile-v3.7.1-${RULES_VERSION}" "Sonar%20way" "web"
createProfile "ictu-ansible-profile-v2.5.1-${RULES_VERSION}" "Sonar%20way" "yaml" # custom sonar-ansible-plugin
createProfile "ictu-cs-profile-v9.3.0-${RULES_VERSION}" "Sonar%20way" "cs" # image csharp-plugin
createProfile "ictu-java-profile-v7.20.0-${RULES_VERSION}" "Sonar%20way" "java" # image java-plugin
createProfile "ictu-js-profile-v10.3.1-${RULES_VERSION}" "Sonar%20way" "js" # image javascript-plugin
createProfile "ictu-kotlin-profile-v2.15.0-${RULES_VERSION}" "Sonar%20way" "kotlin" # image kotlin-plugin
createProfile "ictu-py-profile-v4.3.0-${RULES_VERSION}" "Sonar%20way" "py" # image python-plugin
createProfile "ictu-ts-profile-v10.3.1-${RULES_VERSION}" "Sonar%20way" "ts" # image javascript-plugin
createProfile "ictu-vbnet-profile-v9.3.0-${RULES_VERSION}" "Sonar%20way" "vbnet" # image vbnet-plugin
createProfile "ictu-web-profile-v3.8.0-${RULES_VERSION}" "Sonar%20way" "web" # image html-plugin

wait $PID

0 comments on commit d486b30

Please sign in to comment.