diff --git a/.vib/sonarqube/goss/goss.yaml b/.vib/sonarqube/goss/goss.yaml new file mode 100644 index 000000000000..6a53e0639d4b --- /dev/null +++ b/.vib/sonarqube/goss/goss.yaml @@ -0,0 +1,12 @@ +gossfile: + # Goss tests exclusive to the current container + ../../sonarqube/goss/sonarqube.yaml: {} + # Load scripts from .vib/common/goss/templates + ../../common/goss/templates/check-binaries.yaml: {} + ../../common/goss/templates/check-broken-symlinks.yaml: {} + ../../common/goss/templates/check-ca-certs.yaml: {} + ../../common/goss/templates/check-directories.yaml: {} + ../../common/goss/templates/check-files.yaml: {} + ../../common/goss/templates/check-linked-libraries.yaml: {} + ../../common/goss/templates/check-sed-in-place.yaml: {} + ../../common/goss/templates/check-spdx.yaml: {} diff --git a/.vib/sonarqube/goss/sonarqube.yaml b/.vib/sonarqube/goss/sonarqube.yaml new file mode 100644 index 000000000000..8b93090697ac --- /dev/null +++ b/.vib/sonarqube/goss/sonarqube.yaml @@ -0,0 +1,24 @@ +file: + /opt/bitnami/sonarqube/bin/linux-x86-64/sonar.sh: + exists: true + filetype: file + contains: + {{ if regexMatch "^8.+" .Env.APP_VERSION }} + - "PIDDIR=\"../../pids\"" + {{ else if regexMatch "^9.+" .Env.APP_VERSION }} + - "PIDFILE=\"/opt/bitnami/sonarqube/pids/$APP_NAME.pid\"" + {{ end }} + # Test specific for branch@8 + {{ if regexMatch "^8.+" .Env.APP_VERSION }} + /opt/bitnami/sonarqube/conf/wrapper.conf: + exists: true + filetype: file + contains: + - "wrapper.logfile.rollmode=NONE" + {{ end }} +group: + sonarqube: + exists: true +user: + sonarqube: + exists: true diff --git a/.vib/sonarqube/goss/vars.yaml b/.vib/sonarqube/goss/vars.yaml new file mode 100644 index 000000000000..bd3755c1034d --- /dev/null +++ b/.vib/sonarqube/goss/vars.yaml @@ -0,0 +1,19 @@ +binaries: + - gosu + - java + - psql +directories: + - mode: "0775" + paths: + - /bitnami/sonarqube + - /bitnami/sonarqube-provisioning + - /opt/bitnami/sonarqube/data + - /opt/bitnami/sonarqube/extensions + - /opt/bitnami/sonarqube/logs + - /opt/bitnami/sonarqube/temp + - /opt/bitnami/sonarqube/pids +files: + - mode: "0664" + paths: + - /opt/bitnami/sonarqube/conf/sonar.properties +root_dir: /opt/bitnami diff --git a/.vib/sonarqube/vib-publish.json b/.vib/sonarqube/vib-publish.json index f78e8677530a..dac32b06971f 100644 --- a/.vib/sonarqube/vib-publish.json +++ b/.vib/sonarqube/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -63,9 +64,24 @@ "url": "{VIB_ENV_PACKAGES_JSON_URL}", "path": "/{VIB_ENV_PATH}", "authn": { - "header": "Authorization", - "token": "Bearer {VIB_ENV_GITHUB_TOKEN}" - } + "header": "Authorization", + "token": "Bearer {VIB_ENV_GITHUB_TOKEN}" + } + } + } + }, + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "sonarqube/goss/goss.yaml", + "vars_file": "sonarqube/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-sonarqube" + } } } } diff --git a/.vib/sonarqube/vib-verify.json b/.vib/sonarqube/vib-verify.json index a34e8aee9161..3c6def2993a6 100644 --- a/.vib/sonarqube/vib-verify.json +++ b/.vib/sonarqube/vib-verify.json @@ -3,7 +3,8 @@ "resources": { "url": "{SHA_ARCHIVE}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -46,6 +47,21 @@ "OS" ] } + }, + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "sonarqube/goss/goss.yaml", + "vars_file": "sonarqube/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-sonarqube" + } + } + } } ] }