~evilham/cdist-evilham

8b99eeab3d8e805f3fa92a0c4b42b0f3b77ed77f — Michelle 1 year, 9 months ago b48871f
Added custom_commands parameter

Custom commands that can be added to the app.yml file on discourse for
the execution of lines of code. Mainly use for adding plugins for
discourse.
M type/__evilham_discourse/files/standalone.yml.sh => type/__evilham_discourse/files/standalone.yml.sh +12 -1
@@ 20,6 20,17 @@ else
	DISCOURSE_DEFAULT_LOCALE="DISCOURSE_DEFAULT_LOCALE: ${DISCOURSE_LOCALE}"
fi

HOOK_COMMANDS='# Custom hook commands'
while IFS='' read -r cmd;
do
HOOK_COMMANDS="$(cat <<EOF
${HOOK_COMMANDS}
	- ${cmd}
EOF
)"
done <<EOF
${CUSTOM_COMMANDS}
EOF
# shellcheck disable=SC2034  # This is intended to be included
DISCOURSE_YML="$(cat <<EOF
## Remotely managed with cdist, changes will be lost


@@ 125,7 136,7 @@ hooks:
        cd: \$home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git

${HOOK_COMMANDS}
## Any custom commands to run after building
run:
  - exec: echo "Beginning of custom commands"

M type/__evilham_discourse/man.rst => type/__evilham_discourse/man.rst +3 -0
@@ 69,6 69,9 @@ developer-email
    If it is set though, you will have to list `--admin-email` here too if you
    want it to be able to register an admin account.

custom-commands
    Custom commands that will be added to app.yml file as a line of code to be
    executed. Mainly use for adding plugins for discourse.

EXAMPLES
--------

M type/__evilham_discourse/manifest => type/__evilham_discourse/manifest +3 -0
@@ 77,11 77,14 @@ __git "${DISCOURSE_DIR}" --source "${DISCOURSE_REPO}" \
	--branch "master"  # TODO: Fix
export require="${require} __git/${DISCOURSE_DIR}"

CUSTOM_COMMANDS="$(cat "${__object}/parameter/custom_commands" || true)"

# Add upstream config for easy comparison
__file "${CONFIG_FILE}.orig" --source "${__type}/files/standalone.yml.orig"
# This defines DISCOURSE_YML
# shellcheck source=type/__evilham_discourse/files/standalone.yml.sh
. "${__type}/files/standalone.yml.sh"

__file "${CONFIG_FILE}" \
	--onchange "'${DISCOURSE_DIR}/launcher' rebuild app && yes | '${DISCOURSE_DIR}/launcher' cleanup" \
	--source '-' <<EOF

M type/__evilham_discourse/parameter/optional_multiple => type/__evilham_discourse/parameter/optional_multiple +1 -0
@@ 1,1 1,2 @@
developer-email
custom_commands