Sha256: e98e08bc50412a3fb46c1afd71756733944cfa3c4ca74ab4c07296b90d61f061

Contents?: true

Size: 833 Bytes

Versions: 21

Compression:

Stored size: 833 Bytes

Contents

require "bard/git"
require "bard/command"

module Bard::CLI::Stage
  def self.included mod
    mod.class_eval do

      desc "stage [branch=HEAD]", "pushes current branch, and stages it"
      def stage branch=Bard::Git.current_branch
        unless config.servers.key?(:production)
          raise Thor::Error.new("`bard stage` is disabled until a production server is defined. Until then, please use `bard deploy` to deploy to the staging server.")
        end

        run! "git push -u origin #{branch}", verbose: true
        config[:staging].run! "git fetch && git checkout -f origin/#{branch} && bin/setup"
        puts green("Stage Succeeded")

        ping :staging
      rescue Bard::Command::Error => e
        puts red("!!! ") + "Running command failed: #{yellow(e.message)}"
        exit 1
      end

    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
bard-1.3.9 lib/bard/cli/stage.rb
bard-1.3.8 lib/bard/cli/stage.rb
bard-1.3.7 lib/bard/cli/stage.rb
bard-1.3.6 lib/bard/cli/stage.rb
bard-1.3.5 lib/bard/cli/stage.rb
bard-1.3.4 lib/bard/cli/stage.rb
bard-1.3.3 lib/bard/cli/stage.rb
bard-1.3.2 lib/bard/cli/stage.rb
bard-1.3.1 lib/bard/cli/stage.rb
bard-1.3.0 lib/bard/cli/stage.rb
bard-1.2.0 lib/bard/cli/stage.rb
bard-1.1.2 lib/bard/cli/stage.rb
bard-1.1.1 lib/bard/cli/stage.rb
bard-1.1.0 lib/bard/cli/stage.rb
bard-1.0.8 lib/bard/cli/stage.rb
bard-1.0.7 lib/bard/cli/stage.rb
bard-1.0.6 lib/bard/cli/stage.rb
bard-1.0.5 lib/bard/cli/stage.rb
bard-1.0.4 lib/bard/cli/stage.rb
bard-1.0.3 lib/bard/cli/stage.rb