capistrano-gity 0.2.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3ce3ce5cf90ffe153fc387d45c34d90eef26b0adc0442ba3722c1137f52023b8
4
+ data.tar.gz: 2e846cccc39deb0369fca8b8bfbdfbdd5799180f717c74a0f0a87b29442fd1e3
5
+ SHA512:
6
+ metadata.gz: a007f565d9bfb1f714f7fb27397a04763328bbd438fe1fecb2c91a346724766f1b32cb326ebd2850004b9f00e8cedf370e3be0f14b11a19ce1eff2c9ed799d05
7
+ data.tar.gz: bac8db57f85c994aec2d346862b7d4070fbe9ea5268772aaea418ab0d3d8070b4cbfef113bb52e1b4c3a8fd45f323f9905961346177c6279f26112b12b9269f3
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "capistrano-gity"
5
+ s.version = "0.6.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Skroutz.gr Team"]
9
+ s.date = "2012-05-21"
10
+ s.email = "yatiohi@ideopolis.gr"
11
+ s.extra_rdoc_files = [
12
+ "LICENSE",
13
+ "README.rdoc"
14
+ ]
15
+ s.files = [
16
+ "LICENSE",
17
+ "README.rdoc",
18
+ "capistrano-gity.gemspec",
19
+ "lib/capistrano-gity.rb"
20
+ ]
21
+ s.homepage = "http://github.com/ctrochalakis/capistrano-gity"
22
+ s.require_paths = ["lib"]
23
+ s.rubygems_version = "1.8.11"
24
+ s.summary = "Git helpers for capistrano deployments"
25
+
26
+ if s.respond_to? :specification_version then
27
+ s.specification_version = 3
28
+
29
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
30
+ else
31
+ end
32
+ else
33
+ end
34
+ end
35
+
@@ -7,6 +7,19 @@ Capistrano::Configuration.instance.load do
7
7
  set :remote, git_remote.empty? ? 'origin' : git_remote
8
8
  end
9
9
 
10
+ unless exists?(:check_master)
11
+ check_master = case `git config deploy.check-master`.strip
12
+ when 'false', 'f', '0'
13
+ false
14
+ when 'true', 't', '1'
15
+ true
16
+ else
17
+ true
18
+ end
19
+
20
+ set :check_master, check_master
21
+ end
22
+
10
23
  desc "Push HEAD to the central repo"
11
24
  task :push do
12
25
  system "git push --force #{remote} HEAD:#{branch}"
@@ -62,12 +75,33 @@ Capistrano::Configuration.instance.load do
62
75
  uptip
63
76
  end
64
77
 
78
+ def quit?
79
+ return false if !check_master
80
+
81
+ current_branch = `git symbolic-ref --short HEAD`.strip
82
+ branch_diff_cmd = "git log #{current_branch} ^#{remote}/master --pretty=format:%h%x09%an%x09%ad%x09%s"
83
+ unpushed_commits = `#{branch_diff_cmd}`
84
+ if !unpushed_commits.empty?
85
+ puts <<-MSG
86
+ The following commits are not included in #{remote} master.
87
+ This means that a subsequent deploy might not include your work.
88
+ Consider pushing to master now or later.
89
+ MSG
90
+ puts unpushed_commits
91
+ answer = Capistrano::CLI.ui.ask("Do you want to continue? (y/n)")
92
+ return !answer.downcase.start_with?('y')
93
+ end
94
+ return false
95
+ end
96
+
65
97
  task :prepare_deploy do
98
+ sync
99
+ exit 127 if quit?
66
100
  push
67
101
  uptip
68
102
  end
69
103
 
70
- before 'deploy', 'gity:prepare_deploy'
104
+ before 'deploy:update_code', 'gity:prepare_deploy'
71
105
 
72
106
  end
73
107
  end
metadata CHANGED
@@ -1,68 +1,47 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: capistrano-gity
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 2
8
- - 0
9
- version: 0.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.0
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Skroutz.gr Team
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2010-03-17 00:00:00 +02:00
18
- default_executable:
11
+ date: 2012-05-21 00:00:00.000000000 Z
19
12
  dependencies: []
20
-
21
13
  description:
22
14
  email: yatiohi@ideopolis.gr
23
15
  executables: []
24
-
25
16
  extensions: []
26
-
27
- extra_rdoc_files:
17
+ extra_rdoc_files:
28
18
  - LICENSE
29
19
  - README.rdoc
30
- files:
31
- - .gitignore
20
+ files:
32
21
  - LICENSE
33
22
  - README.rdoc
34
- - Rakefile
35
- - VERSION
23
+ - capistrano-gity.gemspec
36
24
  - lib/capistrano-gity.rb
37
- has_rdoc: true
38
25
  homepage: http://github.com/ctrochalakis/capistrano-gity
39
26
  licenses: []
40
-
27
+ metadata: {}
41
28
  post_install_message:
42
- rdoc_options:
43
- - --charset=UTF-8
44
- require_paths:
29
+ rdoc_options: []
30
+ require_paths:
45
31
  - lib
46
- required_ruby_version: !ruby/object:Gem::Requirement
47
- requirements:
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ requirements:
48
34
  - - ">="
49
- - !ruby/object:Gem::Version
50
- segments:
51
- - 0
52
- version: "0"
53
- required_rubygems_version: !ruby/object:Gem::Requirement
54
- requirements:
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
55
39
  - - ">="
56
- - !ruby/object:Gem::Version
57
- segments:
58
- - 0
59
- version: "0"
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
60
42
  requirements: []
61
-
62
- rubyforge_project:
63
- rubygems_version: 1.3.6
43
+ rubygems_version: 3.2.5
64
44
  signing_key:
65
45
  specification_version: 3
66
46
  summary: Git helpers for capistrano deployments
67
47
  test_files: []
68
-
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC
data/Rakefile DELETED
@@ -1,16 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "capistrano-gity"
8
- gem.summary = "Git helpers for capistrano deployments"
9
- gem.email = "yatiohi@ideopolis.gr"
10
- gem.homepage = "http://github.com/ctrochalakis/capistrano-gity"
11
- gem.authors = ["Skroutz.gr Team"]
12
- end
13
- Jeweler::GemcutterTasks.new
14
- rescue LoadError
15
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
16
- end
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.0