Sha256: f5c74107e97c88131029711375cc87e46d2785665bffa3226e2b73065bc431c1

Contents?: true

Size: 564 Bytes

Versions: 2

Compression:

Stored size: 564 Bytes

Contents

namespace :capistrano do

  namespace :commit do
    desc 'Save current host revision'
    task :save => :environment do

      m = ActiveRecord::Migration.new
      unless m.table_exists?(:capistrano_commits)
        m.create_table :capistrano_commits do |t|
          t.string :host
          t.string :revision
          t.timestamps
        end
      end

      class CapistranoCommit < ActiveRecord::Base
        self.table_name = :capistrano_commits
      end

      CapistranoCommit.create(host: ENV['HOST'], revision: ENV['REVISION'])

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-commit-0.1.1 lib/tasks/commit.rake
capistrano-commit-0.1.0 lib/tasks/commit.rake