aboutsummaryrefslogtreecommitdiff
path: root/lib/hydra/deploy
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-12-28 20:06:37 -0200
committerSilvio Rhatto <rhatto@riseup.net>2015-12-28 20:06:37 -0200
commit78139f05356e09352356926a351c77f40470bae5 (patch)
tree508746fef3afdfae4c3a6b958810877c2bb45c44 /lib/hydra/deploy
parentd584f6d086c02ee796c8ba9f1a7afc30422b3601 (diff)
downloadhydra-78139f05356e09352356926a351c77f40470bae5.tar.gz
hydra-78139f05356e09352356926a351c77f40470bae5.tar.bz2
Deploy: misc fixes
Diffstat (limited to 'lib/hydra/deploy')
-rw-r--r--lib/hydra/deploy20
1 files changed, 11 insertions, 9 deletions
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