From 88be5083e0cfeda1896cfbc064bd82e092f460b2 Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Mon, 21 Dec 2015 08:23:35 -0800 Subject: [PATCH] filter out Procfile comments. closes #1792. closes #1742 --- dokku | 1 + plugins/ps/functions | 4 +-- tests/apps/nodejs-express/Procfile | 49 ++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/dokku b/dokku index 8ecbd08e0..c656072f1 100755 --- a/dokku +++ b/dokku @@ -104,6 +104,7 @@ case "$1" in DOKKU_DEFAULT_DOCKER_ARGS=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG) while read -r line || [[ -n "$line" ]]; do + [[ "$line" =~ ^#.* ]] && continue TRIM=${line%#*} PROC_TYPE=${TRIM%%=*} PROC_COUNT=${TRIM#*=} diff --git a/plugins/ps/functions b/plugins/ps/functions index 4515008ab..3e7aaac3b 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -26,11 +26,11 @@ generate_scale_file() { echo "web=1" >> $DOKKU_SCALE_FILE else while read -r line || [[ -n "$line" ]]; do - [[ -z "$line" ]] && continue + [[ "$line" =~ ^#.* ]] && continue NAME=${line%%:*} NUM_PROCS=0 [[ "$NAME" == "web" ]] && NUM_PROCS=1 - echo "$NAME=$NUM_PROCS" >> $DOKKU_SCALE_FILE + [[ -n "$NAME" ]] && echo "$NAME=$NUM_PROCS" >> $DOKKU_SCALE_FILE done < "$PROCFILE" fi dokku_log_info1_quiet "New DOKKU_SCALE file generated" diff --git a/tests/apps/nodejs-express/Procfile b/tests/apps/nodejs-express/Procfile index 91da256cc..312461ac9 100644 --- a/tests/apps/nodejs-express/Procfile +++ b/tests/apps/nodejs-express/Procfile @@ -1,3 +1,52 @@ +############################### +# DEVELOPMENT # +############################### + +# Procfile for development using the new threaded worker (scheduler, twitter stream and delayed job) cron: node worker.js web: node web.js worker: node worker.js + + +# Old version with separate processes (use this if you have issues with the threaded version) +# web: bundle exec rails server +# schedule: bundle exec rails runner bin/schedule.rb +# twitter: bundle exec rails runner bin/twitter_stream.rb +# dj: bundle exec script/delayed_job run + +############################### +# PRODUCTION # +############################### + +# You need to copy or link config/unicorn.rb.example to config/unicorn.rb for both production versions. +# Have a look at the deployment guides, if you want to set up huginn on your server: +# https://github.com/cantino/huginn/doc + +# Using the threaded worker (consumes less RAM but can run slower) +# web: bundle exec unicorn -c config/unicorn.rb +# jobs: bundle exec rails runner bin/threaded.rb + +# Old version with separate processes (use this if you have issues with the threaded version) +# web: bundle exec unicorn -c config/unicorn.rb +# schedule: bundle exec rails runner bin/schedule.rb +# twitter: bundle exec rails runner bin/twitter_stream.rb +# dj: bundle exec script/delayed_job run + +############################### +# Multiple DelayedJob workers # +############################### +# Per default Huginn can just run one agent at a time. Using a lot of agents or calling slow +# external services frequently might require more DelayedJob workers (an indicator for this is +# a backlog in your 'Job Management' page). +# Every uncommented line starts an additional DelayedJob worker. This works for development, production +# and for the threaded and separate worker processes. Keep in mind one worker needs about 300MB of RAM. +# +#dj2: bundle exec script/delayed_job -i 2 run +#dj3: bundle exec script/delayed_job -i 3 run +#dj4: bundle exec script/delayed_job -i 4 run +#dj5: bundle exec script/delayed_job -i 5 run +#dj6: bundle exec script/delayed_job -i 6 run +#dj7: bundle exec script/delayed_job -i 7 run +#dj8: bundle exec script/delayed_job -i 8 run +#dj9: bundle exec script/delayed_job -i 9 run +#dj10: bundle exec script/delayed_job -i 10 run