]> gitweb.fluxo.info Git - hydra.git/commitdiff
Create BASEDIR / doc update
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 28 Feb 2014 16:52:52 +0000 (13:52 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 28 Feb 2014 16:52:52 +0000 (13:52 -0300)
README
TODO.md [new file with mode: 0644]
lib/hydra/config
share/hydra/init

diff --git a/README b/README
index b61abc452e275491df54eb0a3d6dec21c400e738..5f635d845677d624bbe7a78f577b60641ca4dffa 100644 (file)
--- a/README
+++ b/README
@@ -10,13 +10,30 @@ This suite is made of three commands:
   - hydra:    issues commands on multiple hosts.
   - hydras:   issues commands to multiple sets of hosts.
 
-TODO
-----
+Installation
+------------
 
-Hydra:
+First, clone the code:
 
-  - Init: create config and doc repositories.
-  - Init: generate puppet repository using "hydractl bootstrap repository"
-  - Sync: split between public and private repositories.
-  - Sync: Git clone URL recommendation which support for both git-annex and non-standard port.
-  - Uniform syntax for specifying nodes (either by hostname or fqdn) on deploy and import-key.
+    git clone git://git.sarava.org/hydra.git
+    cd hydra && git tag -v
+
+Then add hydra folder to your `$PATH` or run the following command to install
+if under `/usr/local`:
+
+    ./hydractl provision
+
+Managing an existing network
+----------------------------
+
+If you have enough credentials, you can fetch all the needed repositories and configurations
+using simply the following command:
+
+    hydra example init ~/file/example ssh://gitolite@admin.example.org/config.git
+
+Creating a new network
+----------------------
+
+To create the needed repositories to start a new network, use a similar command:
+
+    hydra example init ~/file/example
diff --git a/TODO.md b/TODO.md
new file mode 100644 (file)
index 0000000..75e5bee
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,11 @@
+TODO
+====
+
+Hydra
+-----
+
+  - Init: create config and doc repositories.
+  - Init: generate puppet repository using "hydractl bootstrap repository"
+  - Sync: split between public and private repositories.
+  - Sync: Git clone URL recommendation which support for both git-annex and non-standard port.
+  - Uniform syntax for specifying nodes (either by hostname or fqdn) on deploy and import-key.
index e2fa85e760d7e83fc0769fec58646b226dd3e366..37442acf59fbd57cba6bd03c3bc0a992bc219bb3 100644 (file)
@@ -44,6 +44,14 @@ function hydra_check_preferences {
     PUPPET_KEYS="$PUPPET/modules/site_keys/files"
   fi
 
+  if [ ! -z "$REMOTE_REPOS" ]; then
+    echo "Using deprecated config REMOTE_REPOS, please update $PREFERENCES."
+  fi
+
+  if [ ! -z "$PRIVATE_REPOS" ]; then
+    echo "Using deprecated config PRIVATE_REPOS, please update $PREFERENCES."
+  fi
+
   export HYDRA_CONNECT="ssh -T -o ConnectTimeout=15"
 }
 
index dbc2414e93e1b5613d622c9c12a2198d1ba1c573..9b817d078aef8c5becbfc4c4ac1617275122ecca 100755 (executable)
@@ -31,8 +31,14 @@ if [ -z "$BASEDIR" ]; then
 elif grep -q -e "^$HYDRA=" $CONFIG &> /dev/null; then
   echo "Hydra $HYDRA already defined"
   exit 1
+elif [ -d "$BASEDIR" ]; then
+  echo "Folder $BASEDIR already exists, hydra $HYDRA already defined?"
+  exit 1
 fi
 
+# Create base
+mkdir -p $BASEDIR
+
 # Reparse basedir to force absolute folder
 BASEDIR="`cd $BASEDIR && pwd`"
 
@@ -44,8 +50,8 @@ echo "$HYDRA=\"$BASEDIR\"" >> $CONFIG
 
 # Optional remote configuration
 if [ ! -z "$REMOTE" ]; then
-  echo "Using $REMOTE as private gitolite address."
-  echo "PRIVATE_REPOS=$REMOTE" >> $PREFERENCES
+  # Clone configuration repository
+  git clone $REMOTE $BASEDIR/config
 else
   # No remote was given, so we assume this is a shiny new hydra!
   if [ ! -d "$BASEDIR/config" ]; then