chore(gitignore): add post-commit hook to .gitignore
This commit is contained in:
@@ -1,43 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -u
|
|
||||||
|
|
||||||
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
|
|
||||||
SCRIPT_PATH="$REPO_ROOT/scripts/release/pre_release_web.sh"
|
|
||||||
LOG_FILE="$REPO_ROOT/logs/post-commit.log"
|
|
||||||
COMMIT_HASH="$(git rev-parse --short HEAD 2>/dev/null || echo unknown)"
|
|
||||||
GIT_LOCAL_ENV_VARS="$(git rev-parse --local-env-vars 2>/dev/null || true)"
|
|
||||||
|
|
||||||
mkdir -p "$(dirname "$LOG_FILE")"
|
|
||||||
|
|
||||||
{
|
|
||||||
echo "=== post-commit @ $(date +%Y-%m-%dT%H:%M:%S%z) ==="
|
|
||||||
echo "repo: $REPO_ROOT"
|
|
||||||
echo "commit: $COMMIT_HASH"
|
|
||||||
echo "script: $SCRIPT_PATH"
|
|
||||||
echo ""
|
|
||||||
} > "$LOG_FILE"
|
|
||||||
|
|
||||||
if [ ! -x "$SCRIPT_PATH" ]; then
|
|
||||||
{
|
|
||||||
echo "=== ERROR: script not executable or not found ==="
|
|
||||||
echo "path: $SCRIPT_PATH"
|
|
||||||
echo "=== post-commit EXIT_CODE=127 @ $(date +%Y-%m-%dT%H:%M:%S%z) ==="
|
|
||||||
} >> "$LOG_FILE"
|
|
||||||
exit 127
|
|
||||||
fi
|
|
||||||
|
|
||||||
(
|
|
||||||
for var in $GIT_LOCAL_ENV_VARS; do
|
|
||||||
unset "$var"
|
|
||||||
done
|
|
||||||
"$SCRIPT_PATH"
|
|
||||||
) >> "$LOG_FILE" 2>&1
|
|
||||||
EXIT_CODE=$?
|
|
||||||
|
|
||||||
{
|
|
||||||
echo ""
|
|
||||||
echo "=== post-commit EXIT_CODE=$EXIT_CODE @ $(date +%Y-%m-%dT%H:%M:%S%z) ==="
|
|
||||||
} >> "$LOG_FILE"
|
|
||||||
|
|
||||||
exit "$EXIT_CODE"
|
|
||||||
@@ -61,3 +61,5 @@ public/workbox-*.js
|
|||||||
|
|
||||||
# Sentry Config File
|
# Sentry Config File
|
||||||
.env.sentry-build-plugin
|
.env.sentry-build-plugin
|
||||||
|
|
||||||
|
.githooks/post-commit
|
||||||
Reference in New Issue
Block a user