Sha256: 33b4f091aa7c02235b078fdc34deb896de326d1958727e55209f629d6b5fa74f

Contents?: true

Size: 545 Bytes

Versions: 6

Compression:

Stored size: 545 Bytes

Contents

module Bozo::Hooks

  # Hook to tag a git repository when a release is published from a build
  # server.
  class GitTagRelease

    def post_publish
      return unless build_server?
      log_info "Tagging repository for release #{version}"

      tag_name = "rel-#{version}"

      if `git tag`.split("\n").include? tag_name
        raise Bozo::ConfigurationError.new "The tag #{tag_name} already exists"
      end

      execute_command :git, ['git', 'tag', tag_name]
      execute_command :git, ['git', 'push', '--tags']
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bozo-scripts-0.2.1 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.2.0 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.1.10 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.1.9 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.1.8 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.1.7 lib/bozo/hooks/git_tag_release.rb