From 19ec2e97c157e789b00f57ff3fdf80d64513d2c8 Mon Sep 17 00:00:00 2001 From: Francisco de Paz Galan Date: Mon, 22 May 2023 09:53:39 +0200 Subject: [PATCH] [bitnami/appsmith] Add VIB tests (#30871) * [bitnami/appsmith] Add VIB tests Signed-off-by: FraPazGal * Remove VIB trigger Signed-off-by: FraPazGal * Apply suggestions and trigger VIB Signed-off-by: FraPazGal * Remove VIB trigger Signed-off-by: FraPazGal * Add non-default timeout for linked-libs check Signed-off-by: FraPazGal * Trigger VIB Signed-off-by: FraPazGal * Remove VIB trigger Signed-off-by: FraPazGal --------- Signed-off-by: FraPazGal --- .vib/appsmith/goss/appsmith.yaml | 29 ++++++++++++++++++++++++++++ .vib/appsmith/goss/goss.yaml | 12 ++++++++++++ .vib/appsmith/goss/vars.yaml | 33 ++++++++++++++++++++++++++++++++ .vib/appsmith/vib-publish.json | 24 +++++++++++++++++++---- .vib/appsmith/vib-verify.json | 18 ++++++++++++++++- 5 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 .vib/appsmith/goss/appsmith.yaml create mode 100644 .vib/appsmith/goss/goss.yaml create mode 100644 .vib/appsmith/goss/vars.yaml diff --git a/.vib/appsmith/goss/appsmith.yaml b/.vib/appsmith/goss/appsmith.yaml new file mode 100644 index 000000000000..f6d4221d0a23 --- /dev/null +++ b/.vib/appsmith/goss/appsmith.yaml @@ -0,0 +1,29 @@ +file: + /opt/appsmith: + exists: true + filetype: symlink + linked-to: /opt/bitnami/appsmith + /opt/bitnami/appsmith/templates/docker.env.sh: + exists: true + filetype: file + contains: + - /cat.*EOF/ + - APPSMITH_SUPERVISOR_USER +command: + check-server-init: + exec: java -jar /opt/bitnami/appsmith/backend/server.jar + exit-status: 1 + stdout: + - {{ .Env.APP_VERSION }} + - Starting ServerApplication + check-rts-init: + exec: cd /opt/appsmith/rts/ && node --require source-map-support/register server.js + exit-status: 1 + stderr: + - APPSMITH_API_BASE_URL +group: + appsmith: + exists: true +user: + appsmith: + exists: true diff --git a/.vib/appsmith/goss/goss.yaml b/.vib/appsmith/goss/goss.yaml new file mode 100644 index 000000000000..8b5222d8c615 --- /dev/null +++ b/.vib/appsmith/goss/goss.yaml @@ -0,0 +1,12 @@ +gossfile: + # Goss tests exclusive to the current container + ../../appsmith/goss/appsmith.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-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/appsmith/goss/vars.yaml b/.vib/appsmith/goss/vars.yaml new file mode 100644 index 000000000000..995c18a1e627 --- /dev/null +++ b/.vib/appsmith/goss/vars.yaml @@ -0,0 +1,33 @@ +binaries: + - java + - mongosh + - nginx + - node + - python + - render-template + - wait-for-port +directories: + - mode: "0775" + paths: + - /bitnami/appsmith + - /opt/bitnami/appsmith/conf + - /opt/bitnami/appsmith/logs + - /opt/bitnami/appsmith/tmp + - paths: + - /opt/bitnami/appsmith/backend/plugins + - /opt/bitnami/appsmith/editor + - /opt/bitnami/appsmith/templates/client +files: + - mode: "0664" + paths: + - /opt/bitnami/appsmith/conf/docker.env + - paths: + - /opt/bitnami/appsmith/editor/index.html + - /opt/bitnami/appsmith/backend/server.jar + - /opt/bitnami/appsmith/rts/package.json +linked_libraries: + timeout: 45000 +sed_in_place: + exclude_paths: + - /opt/bitnami/appsmith/rts/node_modules +root_dir: /opt/bitnami diff --git a/.vib/appsmith/vib-publish.json b/.vib/appsmith/vib-publish.json index 8b6fe8eab4e6..fdf73014d7fe 100644 --- a/.vib/appsmith/vib-publish.json +++ b/.vib/appsmith/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": "appsmith/goss/goss.yaml", + "vars_file": "appsmith/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-appsmith" + } } } } diff --git a/.vib/appsmith/vib-verify.json b/.vib/appsmith/vib-verify.json index a34e8aee9161..b0d999cb652d 100644 --- a/.vib/appsmith/vib-verify.json +++ b/.vib/appsmith/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": "appsmith/goss/goss.yaml", + "vars_file": "appsmith/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-appsmith" + } + } + } } ] }