diff --git a/.vib/suitecrm/goss/goss.yaml b/.vib/suitecrm/goss/goss.yaml new file mode 100644 index 000000000000..087e7036f7cb --- /dev/null +++ b/.vib/suitecrm/goss/goss.yaml @@ -0,0 +1,13 @@ +gossfile: + # Goss tests exclusive to the current container + ../../suitecrm/goss/suitecrm.yaml: {} + # Load scripts from .vib/common/goss/templates + ../../common/goss/templates/check-apache-libphp.yaml: {} + ../../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/suitecrm/goss/suitecrm.yaml b/.vib/suitecrm/goss/suitecrm.yaml new file mode 100644 index 000000000000..d0c247b4dc84 --- /dev/null +++ b/.vib/suitecrm/goss/suitecrm.yaml @@ -0,0 +1,48 @@ +command: + check-app-version: + # suitecrm_version.php is located at the root path in SuiteCRM 7.x, but in 8.x it can be found in public/legacy + exec: find /opt/bitnami/suitecrm -maxdepth 3 -type f -name suitecrm_version.php -exec grep -Eo "version = '([0-9.]+)'" {} \; + exit-status: 0 + stdout: + - version = '{{ .Env.APP_VERSION }}' + check-enabled-modules: + exec: php -m + exit-status: 0 + stdout: + {{ range $module := .Vars.phpmodules }} + - "{{ $module }}" + {{ end }} +file: + /opt/bitnami/php/etc/php.ini: + exists: true + filetype: file + contains: + - post_max_size = 60M + - upload_max_filesize = 128M + /opt/bitnami/suitecrm/node_modules: + exists: false + # Disabling opcache to be able to modify parameters using the system setting panel + /opt/bitnami/php/etc/php.ini: + exists: true + filetype: file + contains: + - opcache.enable = Off + # HTTP vhost should have been properly rendered + /opt/bitnami/apache/conf/vhosts/suitecrm-vhost.conf: + exists: true + filetype: file + contains: + - /DocumentRoot.*/opt/bitnami/suitecrm/ + # HTTPS vhost should have been properly rendered + /opt/bitnami/apache/conf/vhosts/suitecrm-https-vhost.conf: + exists: true + filetype: file + contains: + - "SSLEngine on" + - /DocumentRoot.*/opt/bitnami/suitecrm/ +group: + daemon: + exists: true +user: + daemon: + exists: true diff --git a/.vib/suitecrm/goss/vars.yaml b/.vib/suitecrm/goss/vars.yaml new file mode 100644 index 000000000000..f4663020b049 --- /dev/null +++ b/.vib/suitecrm/goss/vars.yaml @@ -0,0 +1,29 @@ +binaries: + - apachectl + - mariadb + - php + - render-template +directories: + - mode: "0775" + paths: + - /bitnami/suitecrm + - /opt/bitnami/suitecrm + - /opt/bitnami/suitecrm/tmp + - /opt/bitnami/suitecrm/vendor +files: + - paths: + - /opt/bitnami/suitecrm/composer.json +phpmodules: + # Based on https://docs.suitecrm.com/admin/installation-guide/downloading-installing/#_recommended_installation_pre_requisites + - curl + - json + - mbstring + - mysqli + - pcre + - xml + - zip + - zlib +root_dir: /opt/bitnami +sed_in_place: + exclude_paths: + - \/opt\/bitnami\/suitecrm\/vendor\/.* diff --git a/.vib/suitecrm/vib-publish.json b/.vib/suitecrm/vib-publish.json index 8b6fe8eab4e6..cf606b73316e 100644 --- a/.vib/suitecrm/vib-publish.json +++ b/.vib/suitecrm/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -33,6 +34,21 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "suitecrm/goss/goss.yaml", + "vars_file": "suitecrm/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-suitecrm" + } + } + } + }, { "action_id": "trivy", "params": { diff --git a/.vib/suitecrm/vib-verify.json b/.vib/suitecrm/vib-verify.json index a34e8aee9161..205f4604dca4 100644 --- a/.vib/suitecrm/vib-verify.json +++ b/.vib/suitecrm/vib-verify.json @@ -3,7 +3,8 @@ "resources": { "url": "{SHA_ARCHIVE}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -29,6 +30,21 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "suitecrm/goss/goss.yaml", + "vars_file": "suitecrm/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-suitecrm" + } + } + } + }, { "action_id": "trivy", "params": {