aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-02-28 14:54:29 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-02-28 14:54:29 -0300
commitf847a348c2eae31d5c13b4af443fe0cef16e465e (patch)
tree2c66a05dea8e99a6b6d3b4e186b31fd4590bd740
parent852af63d40c0e1d286fef163088b51f45296024c (diff)
downloadhydra-f847a348c2eae31d5c13b4af443fe0cef16e465e.tar.gz
hydra-f847a348c2eae31d5c13b4af443fe0cef16e465e.tar.bz2
Change from PRIVATE_REPOS to the new config scheme
-rw-r--r--README.md2
-rw-r--r--lib/hydra/config14
-rwxr-xr-xshare/hydra/sync11
3 files changed, 17 insertions, 10 deletions
diff --git a/README.md b/README.md
index 28ce973..a8221ee 100644
--- 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:
diff --git a/lib/hydra/config b/lib/hydra/config
index 37442ac..3cd7cc7 100644
--- a/lib/hydra/config
+++ b/lib/hydra/config
@@ -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"
}
diff --git a/share/hydra/sync b/share/hydra/sync
index d0b7dd8..2b31cb0 100755
--- a/share/hydra/sync
+++ b/share/hydra/sync
@@ -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