mirror of
https://github.com/bitnami/containers.git
synced 2026-02-19 05:27:22 +08:00
[bitnami/discourse] Add VIB tests (#30858)
* [bitnami/discourse] Add VIB tests Signed-off-by: Miguel Ruiz <miruiz@vmware.com> * Update check-linked-libraries Signed-off-by: Miguel Ruiz <miruiz@vmware.com> * Add trigger Signed-off-by: Miguel Ruiz <miruiz@vmware.com> * Apply suggestions Signed-off-by: Miguel Ruiz <miruiz@vmware.com> * Remove triggers Signed-off-by: Miguel Ruiz <miruiz@vmware.com> --------- Signed-off-by: Miguel Ruiz <miruiz@vmware.com>
This commit is contained in:
@@ -4,13 +4,18 @@
|
||||
# - .Vars.root_dir
|
||||
# Optional vars:
|
||||
# - .Vars.linked_libraries.exclude_paths (Array)
|
||||
# - .Vars.linked_libraries.timeout (String)
|
||||
########################
|
||||
command:
|
||||
check-linked-libraries:
|
||||
{{ $exclude_paths := "" }}
|
||||
{{ if contains "linked_libraries:map[exclude_paths:" (.Vars | toString) }}
|
||||
{{ if and (index .Vars "linked_libraries") (index .Vars.linked_libraries "exclude_paths")}}
|
||||
{{ $exclude_paths = (.Vars.linked_libraries.exclude_paths | join "|") }}
|
||||
{{ end }}
|
||||
exec: export BITNAMI_ROOT_DIR={{ .Vars.root_dir }} && export EXCLUDE_PATHS='{{ $exclude_paths }}' && ./common/goss/scripts/check-linked-libraries.sh
|
||||
{{ if and (index .Vars "linked_libraries") (index .Vars.linked_libraries "timeout")}}
|
||||
timeout: {{ .Vars.linked_libraries.timeout }}
|
||||
{{ else }}
|
||||
timeout: 20000
|
||||
{{ end }}
|
||||
exit-status: 0
|
||||
|
||||
28
.vib/discourse/goss/discourse.yaml
Normal file
28
.vib/discourse/goss/discourse.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
command:
|
||||
check-discourse-plugin-install:
|
||||
exec: cd /opt/bitnami/discourse; if [[ ! -d "plugins/discourse-voting" ]]; then RAILS_ENV=production bundle exec rake plugin:install repo=https://github.com/discourse/discourse-voting/; fi
|
||||
exit-status: 0
|
||||
check-discourse-passenger-native-support:
|
||||
exec: /opt/bitnami/discourse/bin/passenger-config build-native-support 2>&1
|
||||
exit-status: 0
|
||||
# Checks output is empty
|
||||
stdout:
|
||||
- '!/./'
|
||||
check-terser-modules:
|
||||
exec: npm list -g
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- terser
|
||||
file:
|
||||
/opt/bitnami/discourse/.image_optim.yml:
|
||||
exists: true
|
||||
filetype: file
|
||||
contains:
|
||||
- "!timeout:"
|
||||
- "svgo: false"
|
||||
group:
|
||||
discourse:
|
||||
exists: true
|
||||
user:
|
||||
discourse:
|
||||
exists: true
|
||||
11
.vib/discourse/goss/goss.yaml
Normal file
11
.vib/discourse/goss/goss.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
gossfile:
|
||||
# Goss tests exclusive to the current container
|
||||
../../discourse/goss/discourse.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: {}
|
||||
26
.vib/discourse/goss/vars.yaml
Normal file
26
.vib/discourse/goss/vars.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
binaries:
|
||||
- wait-for-port
|
||||
- python
|
||||
- ruby
|
||||
- node
|
||||
- brotli
|
||||
- psql
|
||||
- bundle
|
||||
- terser
|
||||
directories:
|
||||
- mode: "0775"
|
||||
paths:
|
||||
- /opt/bitnami/discourse
|
||||
- /bitnami/discourse
|
||||
- /opt/bitnami/discourse/plugins
|
||||
- /opt/bitnami/discourse/public/backups
|
||||
- /opt/bitnami/discourse/public/uploads
|
||||
- /opt/bitnami/discourse/app/assets
|
||||
- /opt/bitnami/discourse/log
|
||||
- /opt/bitnami/discourse/public
|
||||
- /opt/bitnami/discourse/tmp
|
||||
- /home/discourse
|
||||
- /home/discourse/.bundle
|
||||
root_dir: /opt/bitnami
|
||||
linked_libraries:
|
||||
timeout: 60000
|
||||
@@ -3,7 +3,8 @@
|
||||
"resources": {
|
||||
"url": "{VIB_ENV_CONTAINER_URL}",
|
||||
"path": "{VIB_ENV_PATH}"
|
||||
}
|
||||
},
|
||||
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
|
||||
},
|
||||
"phases": {
|
||||
"package": {
|
||||
@@ -32,6 +33,21 @@
|
||||
},
|
||||
"verify": {
|
||||
"actions": [
|
||||
{
|
||||
"action_id": "goss",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib"
|
||||
},
|
||||
"tests_file": "discourse/goss/goss.yaml",
|
||||
"vars_file": "discourse/goss/vars.yaml",
|
||||
"remote": {
|
||||
"pod": {
|
||||
"workload": "deploy-discourse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "trivy",
|
||||
"params": {
|
||||
@@ -64,9 +80,9 @@
|
||||
"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}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"resources": {
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "{VIB_ENV_PATH}"
|
||||
}
|
||||
},
|
||||
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
|
||||
},
|
||||
"phases": {
|
||||
"package": {
|
||||
@@ -29,6 +30,21 @@
|
||||
},
|
||||
"verify": {
|
||||
"actions": [
|
||||
{
|
||||
"action_id": "goss",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib"
|
||||
},
|
||||
"tests_file": "discourse/goss/goss.yaml",
|
||||
"vars_file": "discourse/goss/vars.yaml",
|
||||
"remote": {
|
||||
"pod": {
|
||||
"workload": "deploy-discourse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "trivy",
|
||||
"params": {
|
||||
|
||||
Reference in New Issue
Block a user