aboutsummaryrefslogtreecommitdiff
path: root/share/hydra/init
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/init
parent30f4a09d33f9484381bd3cbd929d75a320c5c348 (diff)
downloadhydra-e59ab973633179150f63441fc41b5f504a302c9f.tar.gz
hydra-e59ab973633179150f63441fc41b5f504a302c9f.tar.bz2
Hydra: sync after init
Diffstat (limited to 'share/hydra/init')
-rwxr-xr-xshare/hydra/init18
1 files changed, 8 insertions, 10 deletions
diff --git a/share/hydra/init b/share/hydra/init
index 791d4e1..8170603 100755
--- a/share/hydra/init
+++ b/share/hydra/init
@@ -22,10 +22,11 @@ hydra_config_load
# Command line arguments
BASEDIR="$1"
+REMOTE="$2"
# Validation
if [ -z "$BASEDIR" ]; then
- echo "Usage: hydra [hydra] register <path>"
+ echo "Usage: hydra [hydra] init <path> [remote]"
exit 1
elif grep -q -e "^$HYDRA=" $CONFIG &> /dev/null; then
echo "Hydra $HYDRA already defined"
@@ -41,14 +42,11 @@ mkdir -p $BASEDIR
chmod 700 $BASEDIR
echo "$HYDRA=\"$BASEDIR\"" >> $CONFIG
-# Puppet configuration
-echo "Searching for a puppet repository at $BASEDIR..."
-PUPPET="$(dirname `find $BASEDIR -name puppet.conf | tail -n 1` 2> /dev/null)"
-
-# TODO: setup or clone initial repositories
-
-if [ ! -z "$PUPPET" ]; then
- echo "Found puppet repository at $PUPPET."
- echo "PUPPET=$PUPPET" >> $PREFERENCES
+# Optional remote configuration
+if [ ! -z "$REMOTE" ]; then
+ echo "Using $REMOTE as private gitolite address."
+ echo "PRIVATE_REPOS=$REMOTE" >> $PREFERENCES
fi
+# Setup or clone initial repositories
+hydra $HYDRA sync