Sha256: 020bd1f1dcc871e2dbb12558b988b36ae8f98780a15406763e576805e35014af

Contents?: true

Size: 964 Bytes

Versions: 7

Compression:

Stored size: 964 Bytes

Contents

require 'thor'
require 'thegarage/gitx'
require 'thegarage/gitx/cli/base_command'
require 'thegarage/gitx/cli/update_command'
require 'thegarage/gitx/cli/integrate_command'
require 'thegarage/gitx/cli/cleanup_command'

module Thegarage
  module Gitx
    module Cli
      class ReleaseCommand < BaseCommand
        desc 'release', 'release the current branch to production'
        def release
          return unless yes?("Release #{current_branch.name} to production? (y/n)", :green)

          branch = current_branch.name
          assert_not_protected_branch!(branch, 'release')
          UpdateCommand.new.update

          run_cmd "git checkout #{Thegarage::Gitx::BASE_BRANCH}"
          run_cmd "git pull origin #{Thegarage::Gitx::BASE_BRANCH}"
          run_cmd "git pull . #{branch}"
          run_cmd "git push origin HEAD"

          IntegrateCommand.new.integrate('staging')
          CleanupCommand.new.cleanup
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
thegarage-gitx-2.0.4 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.0.3 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.0.2 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.0.1 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.0.0 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.0.0.pre2 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.0.0.pre1 lib/thegarage/gitx/cli/release_command.rb