Class: CastCaster::Deploy::Swarm
- Inherits:
-
Object
- Object
- CastCaster::Deploy::Swarm
- Includes:
- FFmpegServices
- Defined in:
- lib/castcaster/deploy/swarm.rb
Instance Method Summary collapse
- #compose_file ⇒ Object
- #deploy_dir ⇒ Object
-
#initialize(engine, channels, cfg) ⇒ Swarm
constructor
A new instance of Swarm.
- #write ⇒ Object
Methods included from FFmpegServices
Constructor Details
#initialize(engine, channels, cfg) ⇒ Swarm
Returns a new instance of Swarm.
6 7 8 9 10 |
# File 'lib/castcaster/deploy/swarm.rb', line 6 def initialize(engine, channels, cfg) @engine = engine @channels = channels @cfg = cfg end |
Instance Method Details
#compose_file ⇒ Object
18 19 20 |
# File 'lib/castcaster/deploy/swarm.rb', line 18 def compose_file File.join(deploy_dir, 'docker-stack.yml') end |
#deploy_dir ⇒ Object
22 23 24 |
# File 'lib/castcaster/deploy/swarm.rb', line 22 def deploy_dir @cfg.fetch('project_dir', Dir.pwd) end |
#write ⇒ Object
12 13 14 15 16 |
# File 'lib/castcaster/deploy/swarm.rb', line 12 def write FileUtils.mkdir_p(deploy_dir) File.write(compose_file, render) compose_file end |