mirror of
https://github.com/dokku/dokku.git
synced 2025-12-28 16:06:40 +01:00
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:
5
dokku
5
dokku
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
2
tests/apps/config/DOKKU_SCALE
Normal file
2
tests/apps/config/DOKKU_SCALE
Normal file
@@ -0,0 +1,2 @@
|
||||
# test comment
|
||||
web=1
|
||||
Reference in New Issue
Block a user