Jobly comes bundled with Sting, which provides you with a
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):
# config/settings.yml host: localhost port: <%= ENV['PORT'] || 3000 %>
settings*.yml files can use the
extends key to load and merge
additional YAML files:
# config/settings.yml extends: some-other-file.yml host: localhost
- The .yml extension is optional.
- You may extend either a single file or an array of files.
This functionality is provided by ExtendedYAML.
Your jobs will have access to a
# jobs/push.rb class Push < Jobly::Job def execute puts settings.host end end
To have the
settings object available to other (non
Jobly::Settings module (or the more inclusive
# app/docker.rb class Docker include Jobly::Settings def pull puts settings.docker_registry end end
See Also: Settings Example