Sha256: d1611a4ddd7a3167788cc6f1113514144a9c346955e2601774f8bc821ed63e1d

Contents?: true

Size: 961 Bytes

Versions: 23

Compression:

Stored size: 961 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

          checkout_branch Thegarage::Gitx::BASE_BRANCH
          run_cmd "git pull origin #{Thegarage::Gitx::BASE_BRANCH}"
          run_cmd "git merge --no-ff #{branch}"
          run_cmd "git push origin HEAD"

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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
thegarage-gitx-2.6.0 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.5.1 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.5.0 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.5.0.beta5 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.5.0.beta4 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.5.0.beta3 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.5.0.beta2 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.5.0.beta1 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.4.2 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.5.0.alpha1 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.4.1 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.4.0 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.4.0.pre1 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.3.0 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.3.0.pre1 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.2.3 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.2.3.pre2 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.2.3.pre1 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.2.2 lib/thegarage/gitx/cli/release_command.rb
thegarage-gitx-2.2.1 lib/thegarage/gitx/cli/release_command.rb