diff --git a/.vib/ghost/goss/ghost.yaml b/.vib/ghost/goss/ghost.yaml new file mode 100644 index 000000000000..7ba685ce4051 --- /dev/null +++ b/.vib/ghost/goss/ghost.yaml @@ -0,0 +1,12 @@ +file: + # Check if node executable directory is symlinked to default bin directory + /opt/bitnami/ghost/bin: + filetype: symlink + linked-to: /opt/bitnami/ghost/versions/{{ .Env.APP_VERSION }}/node_modules/.bin + exists: true +user: + ghost: + exists: true +group: + ghost: + exists: true diff --git a/.vib/ghost/goss/goss.yaml b/.vib/ghost/goss/goss.yaml new file mode 100644 index 000000000000..9480f952ce1b --- /dev/null +++ b/.vib/ghost/goss/goss.yaml @@ -0,0 +1,14 @@ +gossfile: + # Goss tests exclusive to the current container + ../../ghost/goss/ghost.yaml: {} + + # Load scripts from .vib/common/goss/templates + ../../common/goss/templates/check-app-version.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/ghost/goss/vars.yaml b/.vib/ghost/goss/vars.yaml new file mode 100644 index 000000000000..f907ec193b21 --- /dev/null +++ b/.vib/ghost/goss/vars.yaml @@ -0,0 +1,29 @@ +binaries: + - mysql + - node + - python +directories: + - paths: + - /home/ghost + - paths: + # Check that permissions of some directories have been + # specifically set to 777 in postunpack phase + - paths: + - /bitnami/ghost + - /opt/bitnami/ghost + - /opt/bitnami/ghost/content + - /opt/bitnami/ghost/content/logs + - /.ghost + mode: "0777" +files: + - paths: + - /opt/bitnami/ghost/.ghost-cli + mode: "0666" +root_dir: /opt/bitnami +version: + bin_name: cd /opt/bitnami/ghost && ghost + flag: --version +sed_in_place: + exclude_paths: + # Ignore Ghost node_modules directory (not bitnami-related) + - .*\/ghost\/versions\/.*\/node_modules.* diff --git a/.vib/ghost/vib-publish.json b/.vib/ghost/vib-publish.json index 8b6fe8eab4e6..3108c308e627 100644 --- a/.vib/ghost/vib-publish.json +++ b/.vib/ghost/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -77,9 +78,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": "ghost/goss/goss.yaml", + "vars_file": "ghost/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-ghost" + } } } } diff --git a/.vib/ghost/vib-verify.json b/.vib/ghost/vib-verify.json index a34e8aee9161..87d7312f13da 100644 --- a/.vib/ghost/vib-verify.json +++ b/.vib/ghost/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": "ghost/goss/goss.yaml", + "vars_file": "ghost/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-ghost" + } + } + } } ] }