Sha256: fa012be8a3aee644d6aa8cbf3865245ab990dd46addc4bb0bc94ca341786e4d7

Contents?: true

Size: 748 Bytes

Versions: 2

Compression:

Stored size: 748 Bytes

Contents

namespace :git do
  namespace :release do
    desc 'Add tag on success deploy on production'
    task :tag do
      version_number = fetch(:git_tag_name) { release_timestamp }
      tag_name       = "#{fetch(:stage)}-#{version_number}"
      branch         = fetch(:branch, '')
      branch
      system("git tag -a -m \"Version #{tag_name} released\" '#{tag_name}' #{branch}") &&
        `git push --tags` &&
          (puts "Created tag `#{tag_name}`")
    end
  end

  desc 'Updates repository url'
  task :update_repo_url do
    on release_roles :all do
      within repo_path  do
        with fetch(:git_environmental_variables) do
          execute :git, :remote, 'set-url', 'origin', fetch(:repo_url)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
j-cap-recipes-0.0.18 lib/j-cap-recipes/tasks/git.rake
j-cap-recipes-0.0.17 lib/j-cap-recipes/tasks/git.rake