mirror of
https://github.com/tomav/docker-mailserver
synced 2025-08-31 14:25:59 +00:00
Outsourced linting tests into its own file (#1636)
* outsourced linting tests into its own file * trigger rebuild * added SCRIPT variable to setup.sh * trigger rebuild again * major test rewrite * outsourced `hadolint` too * rewrote some parts of the linting logic due to a logic bug * adjusted TravisCI * corrected .bats test line * corrected logging in linting tests * updated `hadolint`
This commit is contained in:
24
setup.sh
24
setup.sh
@@ -3,12 +3,24 @@
|
||||
# Wrapper for various setup scripts
|
||||
# included in the docker-mailserver
|
||||
|
||||
set -euEo pipefail
|
||||
trap '_report_err ${_} ${LINENO} ${?}' ERR
|
||||
SCRIPT='SETUP'
|
||||
|
||||
function _report_err
|
||||
set -euEo pipefail
|
||||
trap '__log_err ${FUNCNAME[0]:-"?"} ${_:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
|
||||
|
||||
function __log_err
|
||||
{
|
||||
echo "ERROR occured :: source ${1} ; line ${2} ; exit code ${3} ;;" >&2
|
||||
local FUNC_NAME LINE EXIT_CODE
|
||||
FUNC_NAME="${1} / ${2}"
|
||||
LINE="${3}"
|
||||
EXIT_CODE="${4}"
|
||||
|
||||
printf "\n––– \e[1m\e[31mUNCHECKED ERROR\e[0m\n%s\n%s\n%s\n%s\n\n" \
|
||||
" – script = ${SCRIPT,,}.sh" \
|
||||
" – function = ${FUNC_NAME}" \
|
||||
" – line = ${LINE}" \
|
||||
" – exit code = ${EXIT_CODE}"
|
||||
|
||||
_unset_vars
|
||||
}
|
||||
|
||||
@@ -88,7 +100,9 @@ function _inspect
|
||||
|
||||
function _usage
|
||||
{
|
||||
echo "Usage: ${0} [-i IMAGE_NAME] [-c CONTAINER_NAME] <subcommand> <subcommand> [args]
|
||||
echo "${SCRIPT,,}.sh
|
||||
|
||||
Usage: ${0} [-i IMAGE_NAME] [-c CONTAINER_NAME] <subcommand> <subcommand> [args]
|
||||
|
||||
OPTIONS:
|
||||
|
||||
|
Reference in New Issue
Block a user