From 62f57741ee98a1a7e3c3d89a9b64d0691ca93451 Mon Sep 17 00:00:00 2001 From: Francisco de Paz Galan Date: Wed, 5 Apr 2023 12:13:11 +0200 Subject: [PATCH] [bitnami/redmine] Add VIB tests (#28656) * [bitnami/redmine] Add VIB tests Signed-off-by: FraPazGal * Remove VIB trigger Signed-off-by: FraPazGal * Remove custom app version check Signed-off-by: FraPazGal --------- Signed-off-by: FraPazGal --- .vib/redmine/goss/goss.yaml | 12 ++++++++++++ .vib/redmine/goss/redmine.yaml | 14 ++++++++++++++ .vib/redmine/goss/vars.yaml | 24 ++++++++++++++++++++++++ .vib/redmine/vib-publish.json | 24 ++++++++++++++++++++---- .vib/redmine/vib-verify.json | 18 +++++++++++++++++- 5 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 .vib/redmine/goss/goss.yaml create mode 100644 .vib/redmine/goss/redmine.yaml create mode 100644 .vib/redmine/goss/vars.yaml diff --git a/.vib/redmine/goss/goss.yaml b/.vib/redmine/goss/goss.yaml new file mode 100644 index 000000000000..88cf0bc3d80b --- /dev/null +++ b/.vib/redmine/goss/goss.yaml @@ -0,0 +1,12 @@ +gossfile: + # Goss tests exclusive to the current container + ../../redmine/goss/redmine.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/redmine/goss/redmine.yaml b/.vib/redmine/goss/redmine.yaml new file mode 100644 index 000000000000..8a3fe6fbccec --- /dev/null +++ b/.vib/redmine/goss/redmine.yaml @@ -0,0 +1,14 @@ +group: + redmine: + exists: true +user: + redmine: + exists: true +command: + check-configured-databases: + # Strips config file of comments and looks for adapters + exec: yq --no-colors '... comments=""' /opt/bitnami/redmine/config/database.yml + exit-status: 0 + stdout: + - /adapter.*mysql/ + - /adapter.*postgresql/ diff --git a/.vib/redmine/goss/vars.yaml b/.vib/redmine/goss/vars.yaml new file mode 100644 index 000000000000..a1f5104ec085 --- /dev/null +++ b/.vib/redmine/goss/vars.yaml @@ -0,0 +1,24 @@ +binaries: + - gosu + - mysql + - psql + - ruby + - yq +directories: + - mode: "0775" + paths: + - /bitnami/redmine + - /opt/bitnami/redmine + - /opt/bitnami/redmine/files + - /opt/bitnami/redmine/plugins + - /opt/bitnami/redmine/public/plugin_assets + - /opt/bitnami/redmine/log + - /opt/bitnami/redmine/tmp + - /opt/bitnami/redmine/config + - /opt/bitnami/redmine/db + - /opt/bitnami/redmine/.bundle +files: + - mode: "0664" + paths: + - /opt/bitnami/redmine/config/configuration.yml +root_dir: /opt/bitnami diff --git a/.vib/redmine/vib-publish.json b/.vib/redmine/vib-publish.json index f78e8677530a..477b59248ec5 100644 --- a/.vib/redmine/vib-publish.json +++ b/.vib/redmine/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": "redmine/goss/goss.yaml", + "vars_file": "redmine/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-redmine" + } } } } diff --git a/.vib/redmine/vib-verify.json b/.vib/redmine/vib-verify.json index a34e8aee9161..b97561a97345 100644 --- a/.vib/redmine/vib-verify.json +++ b/.vib/redmine/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": "redmine/goss/goss.yaml", + "vars_file": "redmine/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-redmine" + } + } + } } ] }