diff --git a/.vib/jsonnet/goss/goss.yaml b/.vib/jsonnet/goss/goss.yaml new file mode 100644 index 000000000000..6bf68fe8a565 --- /dev/null +++ b/.vib/jsonnet/goss/goss.yaml @@ -0,0 +1,10 @@ +gossfile: + # Goss tests exclusive to the current container + ../../jsonnet/goss/jsonnet.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-linked-libraries.yaml: {} + ../../common/goss/templates/check-sed-in-place.yaml: {} + ../../common/goss/templates/check-spdx.yaml: {} diff --git a/.vib/jsonnet/goss/jsonnet.yaml b/.vib/jsonnet/goss/jsonnet.yaml new file mode 100644 index 000000000000..77bcb2785fa0 --- /dev/null +++ b/.vib/jsonnet/goss/jsonnet.yaml @@ -0,0 +1,6 @@ +command: + check-jsonnet-file: + exec: jsonnet ./jsonnet/goss/testfiles/test_template.jsonnet + exit-status: 0 + stdout: + - VIB diff --git a/.vib/jsonnet/goss/testfiles/test_template.jsonnet b/.vib/jsonnet/goss/testfiles/test_template.jsonnet new file mode 100644 index 000000000000..6bb1b4478a1e --- /dev/null +++ b/.vib/jsonnet/goss/testfiles/test_template.jsonnet @@ -0,0 +1,6 @@ +{ + test: { + name: 'VIB', + welcome: 'Hello World!', + }, +} diff --git a/.vib/jsonnet/goss/vars.yaml b/.vib/jsonnet/goss/vars.yaml new file mode 100644 index 000000000000..9d009cff86a5 --- /dev/null +++ b/.vib/jsonnet/goss/vars.yaml @@ -0,0 +1,7 @@ +binaries: + - jsonnet + - jsonnetfmt +root_dir: /opt/bitnami +version: + bin_name: jsonnet + flag: --version diff --git a/.vib/jsonnet/vib-publish.json b/.vib/jsonnet/vib-publish.json index 8b6fe8eab4e6..a5fc97894ce1 100644 --- a/.vib/jsonnet/vib-publish.json +++ b/.vib/jsonnet/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": "jsonnet/goss/goss.yaml", + "vars_file": "jsonnet/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-jsonnet" + } } } } diff --git a/.vib/jsonnet/vib-verify.json b/.vib/jsonnet/vib-verify.json index a34e8aee9161..d72c91e4c4d2 100644 --- a/.vib/jsonnet/vib-verify.json +++ b/.vib/jsonnet/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": "jsonnet/goss/goss.yaml", + "vars_file": "jsonnet/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-jsonnet" + } + } + } } ] }