Sha256: ac529d8d6f40b72f922bf2970181e83eb76cf37f002adb524d41a7b9ba548401

Contents?: true

Size: 928 Bytes

Versions: 17

Compression:

Stored size: 928 Bytes

Contents

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

$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "vmc/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

17 entries across 17 versions & 2 rubygems

Version Path
af-0.5.0.beta.11 Rakefile
af-0.5.0.beta.10 Rakefile
af-0.5.0.beta.9 Rakefile
af-0.5.0.beta.8 Rakefile
af-0.5.0.beta.7 Rakefile
af-0.5.0.beta.6 Rakefile
af-0.5.0.beta.5 Rakefile
af-0.5.0.beta.4 Rakefile
af-0.5.0.beta.3 Rakefile
af-0.5.0.beta.2 Rakefile
af-0.5.0.beta.1 Rakefile
vmc-0.5.0.rc3 Rakefile
vmc-0.5.0.rc2 Rakefile
vmc-0.5.0.rc1 Rakefile
vmc-0.5.0.beta.12 Rakefile
vmc-0.5.0.beta.11 Rakefile
vmc-0.5.0.beta.10 Rakefile