Merge pull request #1413 from progrium/mh-dokku-scale-with-comments

support comments in DOKKU_SCALE and print contents on deploy
This commit is contained in:
Jose Diaz-Gonzalez
2015-08-24 14:26:34 -04:00
3 changed files with 18 additions and 7 deletions

5
dokku
View File

@@ -78,8 +78,9 @@ case "$1" in
while read line || [ -n "$line" ]
do
PROC_TYPE=${line%%=*}
PROC_COUNT=${line#*=}
TRIM=${line%#*}
PROC_TYPE=${TRIM%%=*}
PROC_COUNT=${TRIM#*=}
CONTAINER_INDEX=1
while [[ $CONTAINER_INDEX -le $PROC_COUNT ]];do

View File

@@ -23,18 +23,26 @@ release_and_deploy() {
fi
}
print_dokku_scale_file(){
local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
while read line || [ -n "$line" ]
do
dokku_log_info2_quiet "$line"
done < "$DOKKU_SCALE_FILE"
}
generate_scale_file() {
local APP="$1"; local IMAGE="dokku/$APP"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
copy_from_image "$IMAGE" "/app/DOKKU_SCALE" "$DOKKU_ROOT/$APP" 2>/dev/null || true
if [[ ! -f $DOKKU_SCALE_FILE ]]; then
dokku_log_info1_quiet "DOKKU_SCALE not found in app image. Defaulting to a single web process"
dokku_log_info1_quiet "DOKKU_SCALE file not found in app image. Defaulting to a single web process"
echo "web=1" >> $DOKKU_SCALE_FILE
dokku_log_info1_quiet "New DOKKU_SCALE file generated"
while read line || [ -n "$line" ]
do
dokku_log_info2_quiet "$line"
done < "$DOKKU_SCALE_FILE"
else
dokku_log_info1_quiet "DOKKU_SCALE file found"
print_dokku_scale_file $APP
fi
}

View File

@@ -0,0 +1,2 @@
# test comment
web=1