]> gitweb.fluxo.info Git - hydra.git/commitdiff
Setting/syncing config and doc repositories
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 28 Feb 2014 16:11:16 +0000 (13:11 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 28 Feb 2014 16:11:16 +0000 (13:11 -0300)
README
lib/hydra/usage
share/hydra/init
share/hydra/sync

diff --git a/README b/README
index ab107b2830eaaf7fe62eb4ca5b0649f24c7cc6fc..b61abc452e275491df54eb0a3d6dec21c400e738 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,8 @@
-Hydra Process Command Tool
-==========================
+Hydra Suite - Cloud Command and Control
+=======================================
+
+The Hydra Suite is a complete set of tools for orchestration and management
+of computers.
 
 This suite is made of three commands:
 
@@ -14,7 +17,6 @@ Hydra:
 
   - Init: create config and doc repositories.
   - Init: generate puppet repository using "hydractl bootstrap repository"
-  - Sync: clone hydra configuration repository that should be created by the new init action.
   - 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 32acbb0cdb5b7a6078e3fbc4699bad9eee8062f2..bb34eb84b6085e96da19ea2d3916219cca86f62e 100644 (file)
@@ -10,8 +10,12 @@ function hydra_action_usage {
     echo "Usage: $NAME <command> [arguments]"
   fi
 
+  echo ""
   echo "Available commands:"
   ls $ACTIONS | sed -e 's/^/\t/'
+
+  echo ""
+  echo "Available hydras: "`ls ~/.hydra/ -1 | grep -ve "^config$" | xargs`
 }
 
 # Hydra usage
index ad2f0653c522a1c2e1296aa9dee2c91b333727b9..dbc2414e93e1b5613d622c9c12a2198d1ba1c573 100755 (executable)
@@ -47,24 +47,28 @@ if [ ! -z "$REMOTE" ]; then
   echo "Using $REMOTE as private gitolite address."
   echo "PRIVATE_REPOS=$REMOTE" >> $PREFERENCES
 else
-  # TODO: setup remotes and README content
   # No remote was given, so we assume this is a shiny new hydra!
-  mkdir $BASEDIR/{config,doc}
-  (
-    cd $BASEDIR/config
-    touch README.md
-    git init
-    git add .
-    git commit -m "Initial import"
-  )
+  if [ ! -d "$BASEDIR/config" ]; then
+    mkdir -p "$BASEDIR/config"
+    (
+      cd $BASEDIR/config
+      echo "Hydra $HYDRA config repository" > README.md
+      git init
+      git add .
+      git commit -m "Initial import"
+    )
+  fi
 
-  (
-    cd $BASEDIR/doc
-    touch README.md
-    git init
-    git add .
-    git commit -m "Initial import"
-  )
+  if [ ! -d "$BASEDIR/doc" ]; then
+    mkdir -p "$BASEDIR/doc"
+    (
+      cd $BASEDIR/doc
+      echo "Use this repository for notes about Hydra $HYDRA" > README.md
+      git init
+      git add .
+      git commit -m "Initial import"
+    )
+  fi
 fi
 
 # Sync repositories
index b65a95ef21efab91bc2aef127edb36af63702a8c..56eeeded438a206a7e7dbdebcb96bca95d3aa21f 100755 (executable)
@@ -26,7 +26,7 @@ function hydra_sync {
       continue
     fi
   
-    if [ ! -d "$HYDRA_FOLDER/$repository/.git" ]; then
+    if [ ! -d "$HYDRA_FOLDER/$repository" ]; then
       git clone $PRIVATE_REPOS/$repository $HYDRA_FOLDER/$repository
     fi
   
@@ -44,7 +44,7 @@ function hydra_sync {
 
 # Basic parameters.
 if [ -z "$1" ]; then
-  REPOSITORIES="bootless dns gitolite/public gitolite/private gitosis/public gitosis/private puppet"
+  REPOSITORIES="config doc bootless dns gitolite/public gitolite/private gitosis/public gitosis/private puppet"
 else
   REPOSITORIES="$*"
   UPDATE_KEYRINGER="no"