]> gitweb.fluxo.info Git - hydra.git/commitdiff
Change from PRIVATE_REPOS to the new config scheme
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 28 Feb 2014 17:54:29 +0000 (14:54 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 28 Feb 2014 17:54:29 +0000 (14:54 -0300)
README.md
lib/hydra/config
share/hydra/sync

index 28ce9730dedd126d1a9780f85c16727120a9e6a3..a8221eeb160cd69f533fa2d4635a7f474815e751 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@ Hydra Suite - Cloud Command and Control
 =======================================
 
 The Hydra Suite is a complete set of tools for orchestration and management
-of computers.
+of network of computers.
 
 This suite is made of three commands:
 
index 37442acf59fbd57cba6bd03c3bc0a992bc219bb3..3cd7cc78ec0e8c89a9adc8123d4b33265f1b7f33 100644 (file)
@@ -35,13 +35,9 @@ function hydra_config_load_preferences {
 
 # Check preferences
 function hydra_check_preferences {
-  if [ ! -z "$PUPPET" ] && [ ! -d "$PUPPET" ]; then
-    echo "Puppet folder not found: $PUPPET."
-    exit 1
-  fi
-
-  if [ -z "$PUPPET_KEYS" ]; then
-    PUPPET_KEYS="$PUPPET/modules/site_keys/files"
+  # Check for parameters that should not be set in preferences anymore
+  if [ ! -z "$PUPPET" ]; then
+    echo "Using deprecated config PUPPET, please update $PREFERENCES."
   fi
 
   if [ ! -z "$REMOTE_REPOS" ]; then
@@ -52,6 +48,10 @@ function hydra_check_preferences {
     echo "Using deprecated config PRIVATE_REPOS, please update $PREFERENCES."
   fi
 
+  # Set basic variables
+  PUPPET="$HYDRA_FOLDER/puppet"
+  PUPPET_KEYS="$PUPPET/modules/site_keys/files"
+
   export HYDRA_CONNECT="ssh -T -o ConnectTimeout=15"
 }
 
index d0b7dd872bbbedbb35841c146613cc1886cd8bda..2b31cb092d6075237f3147f13626cf4e01a41e89 100755 (executable)
@@ -19,7 +19,6 @@ source $APP_BASE/lib/hydra/functions || exit 1
 hydra_config_load
 
 # Sync each repository.
-# TODO: change from PRIVATE_REPOS to the new config scheme
 function hydra_sync {
   for repository in $*; do
     if [ "$repository" == "keyringer" ]; then
@@ -28,7 +27,15 @@ function hydra_sync {
     fi
   
     if [ ! -d "$HYDRA_FOLDER/$repository" ]; then
-      git clone $PRIVATE_REPOS/$repository $HYDRA_FOLDER/$repository
+      if [ -e "$HYDRA_FOLDER/config/repository/url" ]; then
+        url="`cat $HYDRA_FOLDER/config/repository/url`"
+      else
+        if [ ! -e "$HYDRA_FOLDER/config/domain" ]; then
+        fi
+        url="gitolite@admin.`cat $HYDRA_FOLDER/config/domain`:$repository"
+      fi
+
+      git clone $url $HYDRA_FOLDER/$repository
     fi
   
     if [ -d "$HYDRA_FOLDER/$repository/.git" ]; then