From 78139f05356e09352356926a351c77f40470bae5 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 28 Dec 2015 20:06:37 -0200 Subject: Deploy: misc fixes --- lib/hydra/deploy | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'lib/hydra/deploy') diff --git a/lib/hydra/deploy b/lib/hydra/deploy index 5c288a5..56c52b8 100644 --- a/lib/hydra/deploy +++ b/lib/hydra/deploy @@ -7,7 +7,6 @@ function hydra_deploy_setup { DEPLOY_DEPENDENCIES="puppet ruby-sqlite3 ruby-activerecord ruby-activerecord-deprecated-finders" DEPLOY_RSYNC="rsync -CrltDvpq --no-owner --exclude=/ssl --exclude=keys --exclude=site_keys --exclude=hiera/secrets --delete --rsync-path" RSYNC_PATH="rsync -q" - COPY_PATH="" if [ "$1" == "remote" ]; then # Deploy in a remote host @@ -19,7 +18,6 @@ function hydra_deploy_setup { DEPLOY_OPTS="$HYDRA_FOLDER/puppet/ $NODE:/etc/puppet/" DEPLOY_DEST="$FQDN:" RSYNC_PATH="sudo rsync -q" - COPY_PATH="$RSYNC_PATH" hydra_deploy_set_manifest else echo "No folder specified." @@ -31,19 +29,21 @@ function hydra_deploy_setup { FOLDER="$2" DEPLOY_BASE="/etc" DEPLOY_COMMAND="$SUDO chroot $FOLDER" + DEPLOY_RSYNC="$SUDO $DEPLOY_RSYNC" DEPLOY_OPTS="$HYDRA_FOLDER/puppet/ $FOLDER/etc/puppet/" DEPLOY_DEST="$FOLDER" - hydra_deploy_set_manifest - - if [ ! -d "$FOLDER"]; then - echo "folder not found: $FOLDER" - exit 1 - fi # Fix hostname if [ -s "$FOLDER/etc/hostname" ]; then FQDN="`cat $FOLDER/etc/hostname`" fi + + hydra_deploy_set_manifest + + if [ ! -d "$FOLDER" ]; then + echo "folder not found: $FOLDER" + exit 1 + fi else echo "No node specified." exit 1 @@ -62,12 +62,13 @@ function hydra_deploy_setup { DOMAIN="`echo $FQDN | cut -d . -f 2-`" ROLE="`hydra_yaml_param nodo::role $HYDRA_FOLDER/puppet/hiera/node/$FQDN.yaml`" LOCATION="`hydra_yaml_param nodo::location $HYDRA_FOLDER/puppet/hiera/node/$FQDN.yaml`" + ENV="LC_ALL=C" # Puppet command if [ -e "$HYDRA_FOLDER/puppet/bin/deploy" ]; then DEPLOY_PUPPET="$DEPLOY_BASE/puppet/bin/deploy" else - DEPLOY_PUPPET="LC_ALL=C puppet apply $PUPPET_OPTS $PUPPET_MANIFEST" + DEPLOY_PUPPET="$ENV puppet apply $PUPPET_OPTS $PUPPET_MANIFEST" fi # Deployment command @@ -142,6 +143,7 @@ function hydra_deploy_copy { local dest="$3" if [ "$location" == "folder" ]; then + $SUDO mkdir -p $dest $SUDO cp $orig $dest elif [ "$location" == "remote" ]; then $DEPLOY_RSYNC "$RSYNC_PATH" $orig $dest -- cgit v1.2.3