Sha256: ef91e1d3c8e7ebf33927a2e4ff7a714b4c2a0d0072c33804ffa03298daf59bb3
Contents?: true
Size: 1.88 KB
Versions: 1
Compression:
Stored size: 1.88 KB
Contents
require 'thor' require 'pp' class ArisControl::Thor < Thor desc 'add/update appname', 'Adds/Updates an aris app.' method_option :email, type: :string, desc: 'The apps email address. Used for web login.' method_option :ssh_key, type: :string, desc: 'The apps ssh public key. Used for git access via ssh.' method_option :pg_role, type: :string, desc: 'The apps postgres role.' method_option :pg_pass, type: :string, desc: 'The apps postgres password.' method_option :env_vars, type: :hash, desc: 'The apps app env vars. Env vars will be accessible inside the app via ENV[VAR-NAME].' def add(name) opts = Hash.new.tap do |o| o[:email] = options[:email] o[:ssh_key] = options[:ssh_key] if options[:ssh_key] o[:pg_role] = options[:pg_role] if options[:pg_role] o[:pg_pass] = options[:pg_pass] if options[:pg_pass] o[:env_vars] = options[:env_vars] if options[:env_vars] end bookkeeper.add(name, **opts) puts "Added/Updated app: #{name}, #{opts}" puts "-----------------------------" print_current_aris_apps end desc 'delete name', 'Deletes aris app' def delete(name) bookkeeper.delete(name) puts "Removed app: #{name}" puts "-----------------------------" print_current_aris_apps end desc 'list', 'Lists current aris-apps' def list print_current_aris_apps end desc 'rollout', 'Runs ansible to provision the current apps.yml state' def rollout provsioner.rollout print_current_aris_apps end desc 'version', 'Prints out aris-control version' def version puts ArisControl::VERSION end private def print_current_aris_apps puts "Current aris app database" puts "-----------------------------" pp bookkeeper.list end def bookkeeper @bookkeeper ||= ArisControl::Bookkeeper.new end def provsioner @provsioner ||= ArisControl::Provisioner.new end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
aris-control-3.1.0 | lib/aris-control/thor.rb |