Sha256: 498df78258499b25f6a3107f358ad0958328627006afb309e509d49e992f9105
Contents?: true
Size: 998 Bytes
Versions: 13
Compression:
Stored size: 998 Bytes
Contents
# frozen_string_literal: true require "dry/monads" module Milestoner module Tags # Handles publishing of tags to a remote repository. class Pusher include Import[:git, :logger] include Dry::Monads[:result] def call version check_remote_repo(version).bind { check_remote_tag version } .bind { push version } end private def check_remote_repo version git.origin? ? Success(version) : Failure("Remote repository not configured.") end def check_remote_tag version git.tag_remote?(version) ? Failure("Remote tag exists: #{version}.") : Success(version) end def push version git.tags_push .either proc { debug version }, proc { Failure "Tags could not be pushed to remote repository." } end def debug version logger.debug { "Local tag pushed: #{version}." } Success version end end end end
Version data entries
13 entries across 13 versions & 1 rubygems