From 173bd5c76143bf1e298106314f1577a94773ed9d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 28 Feb 2014 13:11:16 -0300 Subject: Setting/syncing config and doc repositories --- share/hydra/init | 36 ++++++++++++++++++++---------------- share/hydra/sync | 4 ++-- 2 files changed, 22 insertions(+), 18 deletions(-) (limited to 'share') diff --git a/share/hydra/init b/share/hydra/init index ad2f065..dbc2414 100755 --- a/share/hydra/init +++ b/share/hydra/init @@ -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 diff --git a/share/hydra/sync b/share/hydra/sync index b65a95e..56eeede 100755 --- a/share/hydra/sync +++ b/share/hydra/sync @@ -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" -- cgit v1.2.3