diff --git a/.vib/joomla/goss/goss.yaml b/.vib/joomla/goss/goss.yaml new file mode 100644 index 000000000000..4582e8003d8c --- /dev/null +++ b/.vib/joomla/goss/goss.yaml @@ -0,0 +1,13 @@ +gossfile: + # Goss tests exclusive to the current container + ../../joomla/goss/joomla.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/joomla/goss/joomla.yaml b/.vib/joomla/goss/joomla.yaml new file mode 100644 index 000000000000..70cebd4bd103 --- /dev/null +++ b/.vib/joomla/goss/joomla.yaml @@ -0,0 +1,50 @@ +command: + check-app-version: + exec: grep {{ .Env.APP_VERSION }} /opt/bitnami/joomla/administrator/manifests/files/joomla.xml + exit-status: 0 + # Placeholders in SQL installation files should have been substituted + sql-placeholders: + exec: grep "#__" /opt/bitnami/joomla/installation/sql/mysql/*.sql | wc -l + exit-status: 0 + stdout: + - /^0/ +file: + # Joomla! should have been configured based on build-time defaults + /opt/bitnami/joomla/configuration.php: + exists: true + filetype: file + contains: + - "public $db = 'bitnami_joomla'" + # PHP settings should have been configured + /opt/bitnami/php/etc/php.ini: + exists: true + filetype: file + contains: + - "memory_limit = 256M" + # HTTP vhost should have been properly rendered + /opt/bitnami/apache/conf/vhosts/joomla-vhost.conf: + exists: true + filetype: file + contains: + - /DocumentRoot.*/opt/bitnami/joomla/ + - "^/administrator$" + # HTTPs vhost should have been properly rendered + /opt/bitnami/apache/conf/vhosts/joomla-https-vhost.conf: + exists: true + filetype: file + contains: + - "SSLEngine on" + - /DocumentRoot.*/opt/bitnami/joomla/ + - "^/administrator$" + # RewriteRule should have been inserted in the htaccess file + /opt/bitnami/apache/conf/vhosts/htaccess/joomla-htaccess.conf: + exists: true + filetype: file + contains: + - 'RewriteRule "^administrator$"' +group: + daemon: + exists: true +user: + daemon: + exists: true diff --git a/.vib/joomla/goss/vars.yaml b/.vib/joomla/goss/vars.yaml new file mode 100644 index 000000000000..534b18e45473 --- /dev/null +++ b/.vib/joomla/goss/vars.yaml @@ -0,0 +1,16 @@ +binaries: + - apachectl + - mariadb + - php + - render-template +files: + - paths: + - /opt/bitnami/joomla/.htaccess +directories: + - mode: "0775" + paths: + - /bitnami/joomla + - /opt/bitnami/joomla + - /opt/bitnami/joomla/logs + - /opt/bitnami/joomla/tmp +root_dir: /opt/bitnami diff --git a/.vib/joomla/vib-publish.json b/.vib/joomla/vib-publish.json index 8b6fe8eab4e6..93160145f301 100644 --- a/.vib/joomla/vib-publish.json +++ b/.vib/joomla/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -82,6 +83,21 @@ } } } + }, + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "joomla/goss/goss.yaml", + "vars_file": "joomla/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-joomla" + } + } + } } ] }, diff --git a/.vib/joomla/vib-verify.json b/.vib/joomla/vib-verify.json index a34e8aee9161..51ae40feb9fa 100644 --- a/.vib/joomla/vib-verify.json +++ b/.vib/joomla/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": "joomla/goss/goss.yaml", + "vars_file": "joomla/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-joomla" + } + } + } } ] }