Sha256: 4267ae8e3ee92477029cc319763f92077d918d820890ec9ff6d476bf681dac80

Contents?: true

Size: 741 Bytes

Versions: 3

Compression:

Stored size: 741 Bytes

Contents

require "bard/cli/command"
require "bard/provision"

class Bard::CLI::Provision < Bard::CLI::Command
  STEPS = %w[
    SSH
    User
    AuthorizedKeys
    Apt
    MySQL
    Repo
    MasterKey
    RVM
    App
    Passenger
    Data
    HTTP
    LogRotation
    Swapfile
    Deploy
  ]

  desc "provision [ssh_url] --steps=all", "takes an optional ssh url to a raw ubuntu 22.04 install, and readies it in the shape of :production"
  option :steps, type: :array, default: STEPS
  def provision ssh_url=config[:production].ssh
    options[:steps].each do |step|
      require "bard/provision/#{step.downcase}"
      # dup unfreezes the string for later mutation
      Bard::Provision.const_get(step).call(config, ssh_url.dup)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bard-1.4.0 lib/bard/cli/provision.rb
bard-1.3.9 lib/bard/cli/provision.rb
bard-1.3.8 lib/bard/cli/provision.rb