aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-02-28 13:52:52 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-02-28 13:52:52 -0300
commit1d33d02bd37cb38b494991ca0f797dfcaea12e39 (patch)
tree8f559f0783f68522cc214a919706ea16f4793fac
parent173bd5c76143bf1e298106314f1577a94773ed9d (diff)
downloadhydra-1d33d02bd37cb38b494991ca0f797dfcaea12e39.tar.gz
hydra-1d33d02bd37cb38b494991ca0f797dfcaea12e39.tar.bz2
Create BASEDIR / doc update
-rw-r--r--README33
-rw-r--r--TODO.md11
-rw-r--r--lib/hydra/config8
-rwxr-xr-xshare/hydra/init10
4 files changed, 52 insertions, 10 deletions
diff --git a/README b/README
index b61abc4..5f635d8 100644
--- 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
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.
diff --git a/lib/hydra/config b/lib/hydra/config
index e2fa85e..37442ac 100644
--- a/lib/hydra/config
+++ b/lib/hydra/config
@@ -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"
}
diff --git a/share/hydra/init b/share/hydra/init
index dbc2414..9b817d0 100755
--- a/share/hydra/init
+++ b/share/hydra/init
@@ -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