Sha256: a1f15354015bcffb4579e40d1d48fc9af1a03b9050ef4de2c8525253e14d6891
Contents?: true
Size: 1.55 KB
Versions: 13
Compression:
Stored size: 1.55 KB
Contents
module Dandelion module Command class Deploy < Command::Base command 'deploy' class << self def parser(options) OptionParser.new do |opts| opts.banner = 'Usage: deploy [options] [<revision>]' options[:force] = false opts.on('-f', '--force', 'Force deployment') do options[:force] = true end options[:dry] = false opts.on('--dry-run', 'Show what would have been deployed') do options[:dry] = true end end end end def setup(args) @revision = args.shift || 'HEAD' end def execute begin @deployment = deployment(@revision) rescue Git::RevisionError log.fatal("Invalid revision: #{@revision}") exit 1 end log.info("Remote revision: #{@deployment.remote_revision || '---'}") log.info("Deploying revision: #{@deployment.local_revision}") begin @deployment.validate rescue Deployment::FastForwardError if !@options[:force] log.warn('Warning: you are trying to deploy unpushed commits') log.warn('This could potentially prevent others from being able to deploy') log.warn('If you are sure you want to do this, use the -f option to force deployment') exit 1 end end @deployment.deploy log.info("Deployment complete") end end end end
Version data entries
13 entries across 13 versions & 1 rubygems