Sha256: 47d0d6a2bc39e5a0d2177ba32cfd6cd182e61edb81faec88a32921adeefb5e2a
Contents?: true
Size: 1.48 KB
Versions: 16
Compression:
Stored size: 1.48 KB
Contents
require 'dply/strategy' require 'dply/logger' require 'dply/lock' require 'dply/deploy_config' module Dply module Cli class Deploy include Logger attr_reader :argv def initialize(argv) @argv = argv end def run lock.acquire opts.parse!(argv) strategy.deploy end def strategy @strategy ||= Strategy.load(config, options) end def lock @lock ||= Lock.new(Dir.pwd) end def config @config ||= DeployConfig.build("#{Dir.pwd}/deploy.rb") end def opts OptionParser.new do |opts| opts.banner = "Usage: dply deploy [options] [target]" opts.on("-b", "--branch [BRANCH]" , "Specify git branch") do |b| config.branch = b end opts.on("-r", "--revision [REVISION]", "Specify build revision (only used in archive strategy)") do |r| config.revision = r end opts.on("--no-pull", "Enable/disable git pull") do |e| options[:no_pull] = true end opts.on("--skip-git", "Disable git") do |e| options[:skip_git] = true end opts.on("--skip-bundler", "Skip bundle install") do |e| options[:skip_bundler] = true end opts.on("-h", "--help", "Help") do puts opts exit end end end def options @options ||= {} end end end end
Version data entries
16 entries across 16 versions & 1 rubygems