summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2012-11-19 12:05:00 -0400
committerJoey Hess <joey@kitenet.net>2012-11-19 12:05:00 -0400
commitf0b914f3341b7ff9b014498713458384603dfbd6 (patch)
tree2dc809ddd343a8b15fa492d1ed82c11a30534d50
parent9d203dc0942b8a1b9edea296d428ce149c93b319 (diff)
parent5f6c02e23aa11e8840bbe5c59c9e3ff670e81397 (diff)
Merge branch 'autopush' of github.com:agimenez/etckeeper
-rwxr-xr-xcommit.d/99git-push10
-rwxr-xr-xetckeeper4
-rw-r--r--etckeeper.conf3
3 files changed, 17 insertions, 0 deletions
diff --git a/commit.d/99git-push b/commit.d/99git-push
new file mode 100755
index 0000000..0c3cdd1
--- /dev/null
+++ b/commit.d/99git-push
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+if [ "$VCS" = git ] && [ -d .git ] && [ -n "$PUSH_REMOTE" ]; then
+ if git config --get remote.$PUSH_REMOTE.url; then
+ git push $PUSH_REMOTE master
+ else
+ echo "etckeeper warning: Configured remote '$PUSH_REMOTE' is unknown to git"
+ fi
+fi
diff --git a/etckeeper b/etckeeper
index d18b3ed..fad1f20 100755
--- a/etckeeper
+++ b/etckeeper
@@ -57,6 +57,10 @@ if [ ! -z "$AVOID_SPECIAL_FILE_WARNING" ]; then
export AVOID_SPECIAL_FILE_WARNING
fi
+if [ ! -z "$PUSH_REMOTE" ]; then
+ export PUSH_REMOTE
+fi
+
if [ -z "$1" ]; then
usage
elif [ "x$1" = "x-h" ] || [ "x$1" = "x--help" ]; then
diff --git a/etckeeper.conf b/etckeeper.conf
index 4d6dd8a..ccd7684 100644
--- a/etckeeper.conf
+++ b/etckeeper.conf
@@ -36,3 +36,6 @@ HIGHLEVEL_PACKAGE_MANAGER=apt
# The low-level package manager that's being used.
# (dpkg, rpm, pacman-g2, etc)
LOWLEVEL_PACKAGE_MANAGER=dpkg
+
+# Upstream remote
+PUSH_REMOTE=""