Scaffold Cloudron packaging workspace and automation

This commit is contained in:
2025-10-02 12:07:09 -05:00
parent b4121cc932
commit 482d4ff1b8
414 changed files with 6837 additions and 2 deletions

16
scripts/hooks/install_hooks.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
HOOK_DIR="${REPO_ROOT}/.git/hooks"
if [[ ! -d "${HOOK_DIR}" ]]; then
echo "This script must be run inside a git repository." >&2
exit 1
fi
for hook in pre-commit post-commit pre-push; do
ln -sf "${REPO_ROOT}/scripts/hooks/${hook}" "${HOOK_DIR}/${hook}"
chmod +x "${HOOK_DIR}/${hook}"
echo "Installed ${hook} hook"
done

11
scripts/hooks/post-commit Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
if [[ "${SKIP_CI_HOOKS:-}" == "1" ]]; then
echo "Skipping CI hooks because SKIP_CI_HOOKS=1"
exit 0
fi
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
${REPO_ROOT}/scripts/ci_local.sh status || true

11
scripts/hooks/pre-commit Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
if [[ "${SKIP_CI_HOOKS:-}" == "1" ]]; then
echo "Skipping CI hooks because SKIP_CI_HOOKS=1"
exit 0
fi
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
${REPO_ROOT}/scripts/ci_local.sh lint

11
scripts/hooks/pre-push Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
if [[ "${SKIP_CI_HOOKS:-}" == "1" ]]; then
echo "Skipping CI hooks because SKIP_CI_HOOKS=1"
exit 0
fi
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
${REPO_ROOT}/scripts/ci_local.sh packager-smoke