Skip to content

Commit

Permalink
update fluentd-server new
Browse files Browse the repository at this point in the history
  • Loading branch information
sonots committed May 23, 2014
1 parent 0e851f4 commit 9c70845
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/fluentd_server/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class FluentdServer::CLI < Thor
BASE_DIR = File.join(Dir.pwd, "fluentd-server")
DATA_DIR = File.join(BASE_DIR, "data")
LOG_DIR = File.join(BASE_DIR, "log")
JOB_DIR = File.join(BASE_DIR, "jobs")
LOG_FILE = File.join(LOG_DIR, "application.log")
ENV_FILE = File.join(BASE_DIR, ".env")
PROCFILE = File.join(BASE_DIR, "Procfile")
Expand All @@ -17,12 +18,17 @@ class FluentdServer::CLI < Thor
PORT=5126
HOST=0.0.0.0
DATABASE_URL=sqlite3:#{DATA_DIR}/fluentd_server.db
JOB_DIR=#{JOB_DIR}
LOG_PATH=#{LOG_FILE}
LOG_LEVEL=warn
LOG_SHIFT_AGE=0
LOG_SHIFT_SIZE=1048576
EOS

DEFAULT_PROCFILE =<<-EOS
web: unicorn -E production -p $PORT -o $HOST -c config/unicorn.conf
job: fluentd-server job
serf: $(gem path serf-td-agent)/bin/serf agent
EOS

default_command :start
Expand All @@ -34,6 +40,7 @@ def initialize(args = [], opts = [], config = {})
desc "new", "Creates fluentd-server resource directory"
def new
FileUtils.mkdir_p(LOG_DIR)
FileUtils.mkdir_p(JOB_DIR)
File.write ENV_FILE, DEFAULT_DOTENV
File.write PROCFILE, DEFAULT_PROCFILE
FileUtils.cp(File.expand_path("../../../config.ru", __FILE__), CONFIGRU_FILE)
Expand Down

0 comments on commit 9c70845

Please sign in to comment.