Sha256: 3b10fc69d1e5f59ef13b08e1c312c25963caba0b47317b973e8e649fd6285178

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

require 'fileutils'
require 'util'
require 'yaml'

class Generate < Thor
  include DockerMgr::Util
  include Thor::Actions

  def self.source_root
    File.expand_path('../templates',__dir__)
  end

  desc 'ca-installer','generates a new ca-installer package with root certificate and installation script.'
  def ca_installer 
    generate_ca_installer   
  end

  
  desc 'backup-scripts APP_NAME','generates the backup scripts for the given app.'
  def backup_scripts(app_name)
    @app_name = app_name
    app_path = "#{apps_dir}/#{@app_name}"
    hooks = data_services(@app_name)
    hooks << "before_all"
    hooks << "after_all"
    %w(backup restore).each do | hook_type |
      hooks.each do | hook |
        @service = hook
        template_name = hook == 'before_all' || hook == 'after_all' ? hook : hook_type
        template "#{template_name}.erb","#{app_path}/administration/hooks/#{hook_type}.d/#{hook}"
        FileUtils.chmod 0750,"#{app_path}/administration/hooks/#{hook_type}.d/#{hook}"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dockersitter-0.8.1 lib/commands/generate.rb
dockersitter-0.8.0 lib/commands/generate.rb
dockersitter-0.7.0 lib/commands/generate.rb
dockersitter-0.6.0 lib/commands/generate.rb