Sha256: c5e05b231a600999ca52ce854278af50e1520c46ca3e0c3cc1b99b48e8552803

Contents?: true

Size: 591 Bytes

Versions: 36

Compression:

Stored size: 591 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 #{env['BUILD_VERSION_FULL']}"

      tag_name = "rel-#{env['BUILD_VERSION_FULL']}"

      if `git tag`.split("\n").include? tag_name
        log_warn "The tag #{tag_name} already exists"
      else
        execute_command :git, ['git', 'tag', tag_name]
        execute_command :git, ['git', 'push', '--tags']
      end
    end

  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
bozo-scripts-0.18.5 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.18.4 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.18.3 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.18.2 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.18.1 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.18.0 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.17.0 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.16.3 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.16.2 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.16.1 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.16.0 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.15.0 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.14.0 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.13.0 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.12.0 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.11.0 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.10.6 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.10.5 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.10.4 lib/bozo/hooks/git_tag_release.rb
bozo-scripts-0.10.3 lib/bozo/hooks/git_tag_release.rb