Sha256: 6fad2a7a2922778556d650a81b5260efdce375e2277abd4f995ef8c4a83c74be

Contents?: true

Size: 534 Bytes

Versions: 1

Compression:

Stored size: 534 Bytes

Contents

module Employ
  module Git
    extend self

    def tag!(env, tag = nil)
      name = "#{env}-#{Time.now.to_i}"
      `git tag #{name} #{tag} && git push --tags`
    end

    def retag!(env, tag)
      Git.tag! env, tag
    end

    def tags(env)
      `git fetch --tags`
      `git tag | grep ^#{env}-`.lines
    end

    def last_tag(env)
      tags(env).max
    end

    def penultimate_tag(env)
      tags(env).sort.tap(&:pop).last
    end

    def tag_sha(tag)
      `git show #{tag} --format="%H"`.lines.last
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
employ-0.0.1 lib/employ/git.rb