Jobly Configuraion

Configuring Jobly can be done by one of two methods:

  1. Setting environment variables.
  2. Adding a config/jobly.rb to your jobs workspace.

Environment Variable Reference

Environment VariableDefault
JOBLY_ENVIRONMENTdevelopment
JOBLY_API_URLhttp://localhost:3000/do
JOBLY_APP_PATHapp
JOBLY_CONFIG_PATHconfig
JOBLY_REDIS_URLredis://localhost:6379/0
JOBLY_STATUS_EXPIRATION30
JOBLY_JOBS_NAMESPACEunset
JOBLY_LOGunset
JOBLY_SLACK_WEBHOOKunset
JOBLY_SLACK_CHANNEL#general
JOBLY_SLACK_USERJobly
JOBLY_AUTHunset

Jobly Configuration File

# config/jobly.rb
Jobly.configure do |config|
  # Full configuration file. Everything is optional and has defaults.
  # This file is loaded on boot by the server, worker and jobly CLI.
  # ---

  # environment: development | production
  # Sets the environment for the API Sinatra server and for Sidekiq.
  # Default: ENV['JOBLY_ENVIRONMENT'] || 'development'
  config.environment = 'production'

  # api_url: url
  # Sets the URL to the API server.
  # Default: ENV['JOBLY_API_URL'] || 'http://localhost:3000/do'
  config.api_url = 'http://localhost:3000/do'

  # app_path: relative or absolute path
  # Sets the path to the optional folder that may contain support files for
  # the jobs. All ruby files in this folder are loaded first.
  # Default: ENV['JOBLY_APP_PATH'] || 'app'
  config.app_path = 'app'

  # jobs_path: relative or absolute path
  # Sets the path to the jobs folder. All ruby files in this folder are loaded
  # automatically by all of Jobly's components.
  # Default: ENV['JOBLY_JOBS_PATH'] || 'jobs'
  config.jobs_path = 'jobs'

  # config_path: relative or absolute path
  # Sets the path to the config directory. This is where Jobly looks for this
  # jobly.rb configuration file, so it should be set via the environment
  # variable if you wish to change it.
  # Default: ENV['JOBLY_CONFIG_PATH'] || 'config'
  config.config_path = 'config'

  # redis_url: url
  # Sets the full URL to the redis database
  # Default: ENV['JOBLY_REDIS_URL'] || 'redis://localhost:6379/0'
  config.redis_url = 'redis://localhost:6379/0'

  # status_expiration: minutes
  # Sets the number of minutes that completed jobs are kept in the Statuses
  # tab.
  # Default: ENV['JOBLY_STATUS_EXPIRATION'] || 30
  config.status_expiration = 5

  # jobs_namespace: string
  # Sets the namespace (module name) that your jobs are defined in. For 
  # example, if your Job classes are in fact defined as `MyJobs::SomeJob` 
  # then this option should be set to `MyJobs`.
  # Default: ENV['JOBLY_JOBS_NAMESPACE'] || nil
  config.jobs_namespace = nil

  # log: string or logger instance
  # Sets the logger that will be used by the servers and worker. This logger
  # is also available to your jobs with the `logger` method.
  # This can be one of these strings:
  # - stdout
  # - syslog://system:[email protected]:port
  # - filename
  # Or your own Logger instance.
  # Default: ENV['JOBLY_LOG'] || nil (log to STDOUT)
  config.log = 'jobly.log'

  # slack_webhook: url
  # To use the built in slack notifier, set this slack
  # webhook.
  # Default: ENV['JOBLY_SLACK_WEBHOOK']
  config.slack_webhook = "https://hooks.slack.com/..."
  
  # slack_channel: string
  # Sets the default slack channel.
  # This can be overwritten on a per-job basis.
  # Default: ENV['JOBLY_SLACK_CHANNEL'] || '#general'
  config.slack_channel = '#debug'
  
  # slack_user: string
  # Sets the default slack user name to display.
  # This can be overwritten on a per-job basis.
  # Default: ENV['JOBLY_SLACK_USER'] || 'Jobly'
  config.slack_user = 'Botly'
  
  # mounts: hash
  # Mount additional rack apps to the web server.
  config.mounts = { "/my" => MyApp }
  
  # auth: user:password string
  # Set basic authentication for the server and client.
  config.auth = "admin:secret"

end