test with wercker

This commit is contained in:
Michael Hobbs
2014-12-13 18:56:31 -08:00
parent ab7c313411
commit 3706392e65
34 changed files with 380 additions and 63 deletions

View File

@@ -8,7 +8,7 @@ TARGET_DIR="$3"
[[ -f $IMPORT_DIR/.sshcommand ]] && mv $IMPORT_DIR/.sshcommand $TARGET_DIR/.sshcommand
if [[ -f $IMPORT_DIR/.ssh/authorized_keys ]]; then
mkdir -p $TARGET_DIR/.ssh
cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > $TARGET_DIR/.ssh/authorized_keys
cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > tmpfile && mv tmpfile $TARGET_DIR/.ssh/authorized_keys
chmod 0700 $TARGET_DIR/.ssh
chmod 0600 $TARGET_DIR/.ssh/*
fi

View File

@@ -2,7 +2,7 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
echo $(hostname -f) > $DOKKU_ROOT/HOSTNAME
hostname -f > $DOKKU_ROOT/HOSTNAME
fi
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then

View File

@@ -14,7 +14,7 @@ case "$1" in
: | pluginhook backup-export 1 $BACKUP_DIR | tar -cf $BACKUP_TMP_FILE --files-from -
pushd $BACKUP_DIR > /dev/null
ls -d */ | grep -oE '[^/]+' > "$BACKUP_TMP_DIR/.dokku_backup_apps"
find . -maxdepth 1 -type d -not -name . | sed 's:./::g' > "$BACKUP_TMP_DIR/.dokku_backup_apps"
popd > /dev/null
# we want to insert the files in the root of the tar

View File

@@ -56,15 +56,15 @@ sleep $WAIT
# --location Follow redirects
CURL_OPTIONS="-q --compressed --fail --location --max-time 30"
cat "$FILENAME" | while read PATHNAME EXPECTED ; do
while read PATHNAME EXPECTED < "$FILENAME"; do
# Ignore empty lines and lines starting with #
[[ -z "$PATHNAME" || "$PATHNAME" =~ ^\# ]] && continue
[[ -z "$PATHNAME" || "$PATHNAME" =~ ^# ]] && continue
URL="http://$HOSTNAME:$PORT$PATHNAME"
echo "checking with: curl $CURL_OPTIONS $URL"
HTML=$(curl $CURL_OPTIONS $URL)
if [[ -n "$EXPECTED" && ! "$HTML" =~ "$EXPECTED" ]] ; then
if [[ -n "$EXPECTED" && ! "$HTML" =~ $EXPECTED ]] ; then
echo -e "\033[31m\033[1m$URL: expected to but did not find: \"$EXPECTED\"\033[0m"
exit 1
else

View File

@@ -15,21 +15,21 @@ config_styled_hash () {
longest=""
while read -r word; do
KEY=`echo $word | cut -d"=" -f1`
KEY=$(echo $word | cut -d"=" -f1)
if [ ${#KEY} -gt ${#longest} ]; then
longest=$KEY
fi
done <<< "$vars"
while read -r word; do
KEY=`echo $word | cut -d"=" -f1`
VALUE=`echo $word | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"`
KEY=$(echo $word | cut -d"=" -f1)
VALUE=$(echo $word | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//")
num_zeros=$((${#longest} - ${#KEY}))
zeros=" "
while [ $num_zeros -gt 0 ]; do
zeros="$zeros "
num_zeros=$(($num_zeros - 1))
num_zeros=$((num_zeros - 1))
done
echo "$prefix$KEY:$zeros$VALUE"
done <<< "$vars"
@@ -68,7 +68,7 @@ case "$1" in
config_create
[[ ! -s $ENV_FILE ]] && echo "$APP has no config vars" && exit 1
VARS=`cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2-`
VARS=$(grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" $ENV_FILE | cut -d" " -f2-)
for var in "$@"; do
if [[ "$var" == "--shell" ]]; then
@@ -99,7 +99,7 @@ case "$1" in
KEY="$3"
cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | grep "^export $KEY=" | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"
grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" $ENV_FILE | grep "^export $KEY=" | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"
;;
config:set)
@@ -115,7 +115,7 @@ case "$1" in
config_create
ENV_ADD=""
ENV_TEMP=`cat "${ENV_FILE}"`
ENV_TEMP=$(cat "${ENV_FILE}")
RESTART_APP=false
shift 2
@@ -128,8 +128,8 @@ case "$1" in
done
for var; do
KEY=`echo ${var} | cut -d"=" -f1`
VALUE=`echo ${var} | cut -d"=" -f2-`
KEY=$(echo ${var} | cut -d"=" -f1)
VALUE=$(echo ${var} | cut -d"=" -f2-)
if [[ $KEY =~ [a-zA-Z_][a-zA-Z0-9_]* ]]; then
RESTART_APP=true
@@ -162,7 +162,7 @@ ${var}"
fi
config_create
ENV_TEMP=`cat "${ENV_FILE}"`
ENV_TEMP=$(cat "${ENV_FILE}")
VARS="${*:3}"
for var in $VARS; do

View File

@@ -57,7 +57,7 @@ EOF
chmod +x $PRERECEIVE_HOOK
fi
args=$@
args=$*
git-shell -c "$args"
;;

View File

@@ -9,6 +9,6 @@ TARGET_DIR="$3"
cd $IMPORT_DIR
for file in */tls/server.*; do
mkdir -p $(dirname $TARGET_DIR$file)
mkdir -p "$(dirname $TARGET_DIR$file)"
cp $file $TARGET_DIR$file
done

View File

@@ -95,7 +95,7 @@ EOF
[[ -t 0 ]] && echo "Tar archive containing server.crt and server.key expected on stdin" && exit 1
APP="$2"
TEMP_DIR=`mktemp -d`
TEMP_DIR=$(mktemp -d)
cd $TEMP_DIR
tar xvf - <&0
[[ ! -f "$TEMP_DIR/server.crt" ]] && echo "Tar archive missing server.crt" && exit 1