diff --git a/.vib/common/goss/templates/check-directories.yaml b/.vib/common/goss/templates/check-directories.yaml index 8e343a43ee99..16b2efd856f9 100644 --- a/.vib/common/goss/templates/check-directories.yaml +++ b/.vib/common/goss/templates/check-directories.yaml @@ -6,19 +6,23 @@ # - .Vars.directories.paths (Array) # Optional vars: # - .Vars.directories.mode (String) +# - .Vars.directories.owner (String) +# - .Vars.directories.group (String) ######################## file: - {{ range .Vars.directories }} - {{ $mode := "" }} - {{ if contains "mode:" (. | toString) }} - {{ $mode = .mode }} - {{ end }} - {{ range $directory := .paths }} - {{ $directory }}: + {{ range $dirs := .Vars.directories }} + {{ range $path := .paths }} + {{ $path }}: exists: true filetype: directory - {{ if $mode }} - mode: "{{ $mode }}" + {{ if and (index $dirs "mode") }} + mode: "{{ printf "%s" $dirs.mode }}" + {{ end }} + {{ if and (index $dirs "owner") }} + owner: {{ printf "%s" $dirs.owner }} + {{ end }} + {{ if and (index $dirs "group") }} + group: {{ printf "%s" $dirs.group }} {{ end }} {{ end }} {{ end }} diff --git a/.vib/common/goss/templates/check-files.yaml b/.vib/common/goss/templates/check-files.yaml index 8d8d7cf10bdf..b1ec4b924478 100644 --- a/.vib/common/goss/templates/check-files.yaml +++ b/.vib/common/goss/templates/check-files.yaml @@ -6,19 +6,23 @@ # - .Vars.files.paths (Array) # Optional vars: # - .Vars.files.mode (String) +# - .Vars.files.owner (String) +# - .Vars.files.group (String) ######################## file: - {{ range .Vars.files }} - {{ $mode := "" }} - {{ if contains "mode:" (. | toString) }} - {{ $mode = .mode }} - {{ end }} - {{ range $file := .paths }} - {{ $file }}: + {{ range $files := .Vars.files }} + {{ range $path := .paths }} + {{ $path }}: exists: true filetype: file - {{ if $mode }} - mode: "{{ $mode }}" + {{ if and (index $files "mode") }} + mode: "{{ printf "%s" $files.mode }}" + {{ end }} + {{ if and (index $files "owner") }} + owner: {{ printf "%s" $files.owner }} + {{ end }} + {{ if and (index $files "group") }} + group: {{ printf "%s" $files.group }} {{ end }} {{ end }} {{ end }} diff --git a/.vib/parse-dashboard/goss/goss.yaml b/.vib/parse-dashboard/goss/goss.yaml new file mode 100644 index 000000000000..abe1d138d36f --- /dev/null +++ b/.vib/parse-dashboard/goss/goss.yaml @@ -0,0 +1,11 @@ +gossfile: + # Goss tests exclusive to the current container + ../../parse-dashboard/goss/parse-dashboard.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-linked-libraries.yaml: {} + ../../common/goss/templates/check-sed-in-place.yaml: {} + ../../common/goss/templates/check-spdx.yaml: {} diff --git a/.vib/parse-dashboard/goss/parse-dashboard.yaml b/.vib/parse-dashboard/goss/parse-dashboard.yaml new file mode 100644 index 000000000000..1693cb57929f --- /dev/null +++ b/.vib/parse-dashboard/goss/parse-dashboard.yaml @@ -0,0 +1,12 @@ +group: + parsedashboard: + exists: true +user: + parsedashboard: + exists: true +command: + check-app-version: + exec: grep "version" /opt/bitnami/parse-dashboard/package.json + exit-status: 0 + stdout: + - {{ .Env.APP_VERSION }} diff --git a/.vib/parse-dashboard/goss/vars.yaml b/.vib/parse-dashboard/goss/vars.yaml new file mode 100644 index 000000000000..eef3de672b8c --- /dev/null +++ b/.vib/parse-dashboard/goss/vars.yaml @@ -0,0 +1,13 @@ +binaries: + - node + - python +directories: + - mode: "0775" + owner: "parsedashboard" + group: "root" + paths: + - /bitnami/parse-dashboard + - /opt/bitnami/parse-dashboard + - /opt/bitnami/parse-dashboard/tmp + - /opt/bitnami/parse-dashboard/logs +root_dir: /opt/bitnami diff --git a/.vib/parse-dashboard/vib-publish.json b/.vib/parse-dashboard/vib-publish.json index 8b6fe8eab4e6..478698ad3124 100644 --- a/.vib/parse-dashboard/vib-publish.json +++ b/.vib/parse-dashboard/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": "parse-dashboard/goss/goss.yaml", + "vars_file": "parse-dashboard/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-parse-dashboard" + } } } } diff --git a/.vib/parse-dashboard/vib-verify.json b/.vib/parse-dashboard/vib-verify.json index a34e8aee9161..f6c55ad4b9a0 100644 --- a/.vib/parse-dashboard/vib-verify.json +++ b/.vib/parse-dashboard/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": "parse-dashboard/goss/goss.yaml", + "vars_file": "parse-dashboard/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-parse-dashboard" + } + } + } } ] }