Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 69 lines (48 sloc) 1.714 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
release_ops_path = File.expand_path('../releaseops/lib', __FILE__)

# if the special submodule is availabe, use it
# we use a submodule because it doesn't depend on anything else (*cough* bundler)
# and can be shared across projects
#
if File.exists?(release_ops_path)
  require File.join(release_ops_path, 'releaseops')

  # sets up the multi-ruby zk:test_all rake tasks
  ReleaseOps::TestTasks.define_for(*%w[1.8.7 1.9.2 jruby rbx ree 1.9.3])

  # sets up the task :default => 'spec:run' and defines a simple
  # "run the specs with the current rvm profile" task
  ReleaseOps::TestTasks.define_simple_default_for_travis

  # Define a task to run code coverage tests
  ReleaseOps::TestTasks.define_simplecov_tasks

  # set up yard:server, yard:gems, and yard:clean tasks
  # for doing documentation stuff
  ReleaseOps::YardTasks.define

  namespace :zk do
    namespace :gems do
      task :build do
        require 'tmpdir'

        raise "You must specify a TAG" unless ENV['TAG']

        ReleaseOps.with_tmpdir(:prefix => 'zk') do |tmpdir|
          tag = ENV['TAG']

          sh "git clone . #{tmpdir}"

          orig_dir = Dir.getwd

          cd tmpdir do
            sh "git co #{tag} && git reset --hard && git clean -fdx"

            sh "rvm 1.8.7 do gem build zk.gemspec"

            mv FileList['*.gem'], orig_dir
          end
        end
      end

      task :push do
        gems = FileList['*.gem']
        raise "No gemfiles to push!" if gems.empty?

        gems.each do |gem|
          sh "gem push #{gem}"
        end
      end

      task :clean do
        rm_rf FileList['*.gem']
      end

      task :all => [:build, :push, :clean]
    end
  end


  task :clean => 'yard:clean'
end

Something went wrong with that request. Please try again.