Jobly comes bundled with Sting, which provides you with a
settings helper that lets you use custom YAML files for configuring your jobs.
- Optionally, place additional
settings.production.yml) files for each of your environments. These files will be loaded based on the
Before the YAML files are loaded, they are evaluated with ERB, so you can use Ruby code in them (for example, to load environment variables):
host: localhost port: <%= ENV['PORT'] || 3000 %>
settings*.yml files can use the
extends key to load and merge additional YAML files:
extends: some-other-file.yml host: localhost
.ymlextension is optional.
- You may extend either a single file or an array of files.
This functionality is provided by ExtendedYAML.
Using settings in your jobs
Your jobs will have access to a
class Push < Jobly::Job def execute puts settings.host end end
Using settings in other classes
To have the
settings object available to other (non
Jobly::Job) classes, include the
Jobly::Settings module (or the more inclusive
class Docker include Jobly::Settings def pull puts settings.docker_registry end end
See the Settings Example for mode details: