Sha256: 2e431e38dbc7ab12d8289844163f0e5a04965bbaf4bc4b308f998bd07eea1e9f

Contents?: true

Size: 933 Bytes

Versions: 10

Compression:

Stored size: 933 Bytes

Contents

require "rake"
require "rspec/core/rake_task"

$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "cfoundry/version"

RSpec::Core::RakeTask.new(:spec)
task :default => :spec

namespace :deploy do
  def last_staging_sha
    `git rev-parse latest-staging`.strip
  end

  def last_release_sha
    `git rev-parse latest-release`.strip
  end

  def last_staging_ref_was_released?
    last_staging_sha == last_release_sha
  end

  task :staging, :version do |_, args|
    sh "gem bump --push #{"--version #{args.version}" if args.version}" if last_staging_ref_was_released?
    sh "git tag -f latest-staging"
    sh "git push origin :latest-staging"
    sh "git push origin latest-staging"
  end

  task :gem do
    sh "git fetch"
    sh "git checkout #{last_staging_sha}"
    sh "gem release --tag"
    sh "git tag -f latest-release"
    sh "git push origin :latest-release"
    sh "git push origin latest-release"
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
static-1.0.3 vendor/cfoundry-0.5.2/Rakefile
static-1.0.1 vendor/cfoundry-0.5.2/Rakefile
cfoundry-0.5.3.rc2 Rakefile
cfoundry-0.5.3.rc1 Rakefile
cfoundry-0.5.2 Rakefile
cfoundry-0.5.1.rc5 Rakefile
cfoundry-0.5.1.rc4 Rakefile
cfoundry-0.5.1.rc3 Rakefile
cfoundry-0.5.1.rc2 Rakefile
cfoundry-0.5.1.rc1 Rakefile