cap-git-tags 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/cap-git-tags.gemspec +2 -2
- data/lib/capistrano/git-tags/configuration.rb +0 -0
- data/lib/capistrano/git-tags/version.rb +5 -0
- data/lib/capistrano/git-tags.rb +28 -0
- data/lib/{cap-git-tags → capistrano}/tasks/git_tags.rake +3 -3
- metadata +5 -4
- data/lib/cap-git-tags/version.rb +0 -3
- data/lib/cap-git-tags.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c9c34b9376c8b534f13f6fdc91c69cd3b25eefa
|
4
|
+
data.tar.gz: d3208625957567aad8c0ca73e524ead389bc344f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f99ea2c948a99221f1bdf94ddad5a16905aa90dc61d0d4d2ad5626b6d979814e9306f24b383d5554639641e94dc386285b806a4613f2b051bb70e8ac217c5345
|
7
|
+
data.tar.gz: ebbc57b5ca1ba7e0af60bfe9d81b3027faed432ccde6e5d52f4d11a02eb32e969e1558ab3da5b79d1b2e04a142cee5054af95ba3aca42a8616386ef515b92030
|
data/README.md
CHANGED
data/cap-git-tags.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require '
|
4
|
+
require 'capistrano/git-tags/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "cap-git-tags"
|
8
|
-
spec.version =
|
8
|
+
spec.version = Capistrano::GitTags::VERSION
|
9
9
|
spec.authors = ["Pete Hawkins", "Adrian Dugan"]
|
10
10
|
spec.email = ["pete@phawk.co.uk", "rant@dugg.ie"]
|
11
11
|
spec.description = %q{This is a capistrano 3 plugin for auto tagging your git deploys.}
|
File without changes
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Ensure deploy tasks are loaded before we run
|
2
|
+
require 'capistrano/deploy'
|
3
|
+
|
4
|
+
# Load extra tasks into the deploy namespace
|
5
|
+
load File.expand_path("../tasks/git_tags.rake", __FILE__)
|
6
|
+
|
7
|
+
module Capistrano
|
8
|
+
module GitTags
|
9
|
+
class Helper
|
10
|
+
|
11
|
+
def self.git(cmd)
|
12
|
+
`git #{cmd} 2>&1`.chomp
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.publish_tag(tag_name)
|
16
|
+
git "tag -a #{tag_name} -m \"Auto created deploy tag\""
|
17
|
+
git "push origin --tags"
|
18
|
+
|
19
|
+
"#{tag_name}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.current_branch
|
23
|
+
git "rev-parse --abbrev-ref HEAD"
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -24,7 +24,7 @@ namespace :gittags do
|
|
24
24
|
|
25
25
|
unless ENV['TAG']
|
26
26
|
info "Publishing tag: #{production_tag}"
|
27
|
-
|
27
|
+
Capistrano::GitTags::Helper.publish_tag production_tag
|
28
28
|
end
|
29
29
|
|
30
30
|
set :branch, production_tag
|
@@ -38,14 +38,14 @@ namespace :gittags do
|
|
38
38
|
staging_tag = "staging-#{time.year}-#{time.month}-#{time.day}-#{time.hour}-#{time.min}-#{safe_tag}"
|
39
39
|
|
40
40
|
info "Publishing tag: #{staging_tag}"
|
41
|
-
|
41
|
+
Capistrano::GitTags::Helper.publish_tag staging_tag
|
42
42
|
|
43
43
|
info "Deploying: #{staging_tag} to staging"
|
44
44
|
set :branch, staging_tag
|
45
45
|
else
|
46
46
|
# dev environments allow any branch to be pushed and don't create a tag
|
47
47
|
info "About to deploy your current branch, enter a different branch name to override"
|
48
|
-
ask :branch, proc {
|
48
|
+
ask :branch, proc { Capistrano::GitTags::Helper.current_branch }
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cap-git-tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Hawkins
|
@@ -54,9 +54,10 @@ files:
|
|
54
54
|
- Rakefile
|
55
55
|
- cap-git-tags.gemspec
|
56
56
|
- changelog.md
|
57
|
-
- lib/
|
58
|
-
- lib/
|
59
|
-
- lib/
|
57
|
+
- lib/capistrano/git-tags.rb
|
58
|
+
- lib/capistrano/git-tags/configuration.rb
|
59
|
+
- lib/capistrano/git-tags/version.rb
|
60
|
+
- lib/capistrano/tasks/git_tags.rake
|
60
61
|
homepage: https://github.com/phawk/cap-git-tags
|
61
62
|
licenses:
|
62
63
|
- MIT
|
data/lib/cap-git-tags/version.rb
DELETED
data/lib/cap-git-tags.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# Ensure deploy tasks are loaded before we run
|
2
|
-
require 'capistrano/deploy'
|
3
|
-
|
4
|
-
# Load extra tasks into the deploy namespace
|
5
|
-
load File.expand_path("../cap-git-tags/tasks/git_tags.rake", __FILE__)
|
6
|
-
|
7
|
-
module CapGitTags
|
8
|
-
class Helper
|
9
|
-
|
10
|
-
def self.git(cmd)
|
11
|
-
`git #{cmd} 2>&1`.chomp
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.publish_tag(tag_name)
|
15
|
-
git "tag -a #{tag_name} -m \"Auto created deploy tag\""
|
16
|
-
git "push origin --tags"
|
17
|
-
|
18
|
-
"#{tag_name}"
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.current_branch
|
22
|
-
git "rev-parse --abbrev-ref HEAD"
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|