Scaffold Cloudron packaging workspace and automation
This commit is contained in:
16
scripts/hooks/install_hooks.sh
Executable file
16
scripts/hooks/install_hooks.sh
Executable 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
11
scripts/hooks/post-commit
Executable 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
11
scripts/hooks/pre-commit
Executable 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
11
scripts/hooks/pre-push
Executable 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
|
Reference in New Issue
Block a user