aboutsummaryrefslogtreecommitdiff
path: root/share/hydra/sync
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-10-22 22:57:56 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-10-22 22:57:56 -0200
commite59ab973633179150f63441fc41b5f504a302c9f (patch)
treee73d8d3e142a09eb47485c781697c8df753608de /share/hydra/sync
parent30f4a09d33f9484381bd3cbd929d75a320c5c348 (diff)
downloadhydra-e59ab973633179150f63441fc41b5f504a302c9f.tar.gz
hydra-e59ab973633179150f63441fc41b5f504a302c9f.tar.bz2
Hydra: sync after init
Diffstat (limited to 'share/hydra/sync')
-rwxr-xr-xshare/hydra/sync19
1 files changed, 19 insertions, 0 deletions
diff --git a/share/hydra/sync b/share/hydra/sync
index e3fb571..1c3724d 100755
--- a/share/hydra/sync
+++ b/share/hydra/sync
@@ -27,15 +27,21 @@ else
fi
# Sync each repository.
+# TODO: split between public and private repositories
for repository in $REPOSITORIES; do
if [ "$repository" == "keyringer" ]; then
UPDATE_KEYRINGER="yes"
continue
fi
+ if [ ! -d "$HYDRA_FOLDER/$repository/.git" ]; then
+ git clone $PRIVATE_REPOS/$repository $HYDRA_FOLDER/$repository
+ fi
+
if [ -d "$HYDRA_FOLDER/$repository/.git" ]; then
echo "Syncing $repository..."
+ # TODO: check if git-annex is installed
if [ "$repository" == "bootless" ]; then
( cd $HYDRA_FOLDER/$repository && git annex sync )
else
@@ -49,3 +55,16 @@ if [ "$UPDATE_KEYRINGER" != "no" ]; then
echo "Syncing keyringer..."
keyringer $HYDRA git pull
fi
+
+# Update puppet configuration.
+if [ -z "$PUPPET" ]; then
+ echo "Searching for a puppet repository at $BASEDIR..."
+ PUPPET="$(dirname `find $BASEDIR -name puppet.conf | tail -n 1` 2> /dev/null)"
+
+ if [ ! -z "$PUPPET" ]; then
+ if ! grep -q -e "^PUPPET=" $PREFERENCES; then
+ echo "Found puppet repository at $PUPPET."
+ echo "PUPPET=$PUPPET" >> $PREFERENCES
+ fi
+ fi
+fi