capistrano-gity 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +18 -0
- data/README.rdoc +9 -0
- data/Rakefile +16 -0
- data/VERSION +1 -0
- data/lib/capistrano-gity.rb +78 -0
- data/test/helper.rb +10 -0
- data/test/test_capistrano-gity.rb +7 -0
- metadata +65 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
2
|
+
a copy of this software and associated documentation files (the
|
3
|
+
"Software"), to deal in the Software without restriction, including
|
4
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
5
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
6
|
+
permit persons to whom the Software is furnished to do so, subject to
|
7
|
+
the following conditions:
|
8
|
+
|
9
|
+
The above copyright notice and this permission notice shall be
|
10
|
+
included in all copies or substantial portions of the Software.
|
11
|
+
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
13
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
14
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
15
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
16
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
17
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
18
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
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
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1,78 @@
|
|
1
|
+
Capistrano::Configuration.instance.load do
|
2
|
+
namespace :gity do
|
3
|
+
|
4
|
+
# Most people use origin here
|
5
|
+
unless exists?(:remote)
|
6
|
+
set :remote, 'origin'
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "Mark current commit (HEAD) and push it the central repo"
|
10
|
+
task :push do
|
11
|
+
if not `git rev-parse --symbolic-full-name HEAD`.chomp["refs/heads/#{branch}"]
|
12
|
+
system "git branch -f #{branch} HEAD"
|
13
|
+
end
|
14
|
+
system "git push --force #{remote} #{branch}"
|
15
|
+
end
|
16
|
+
|
17
|
+
task :sync do
|
18
|
+
system "git fetch #{remote}"
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "View a graph log of the commits usually involved in a deployment"
|
22
|
+
task :status do
|
23
|
+
puts "\nOverview (we are deploying origin/#{branch})"
|
24
|
+
sync
|
25
|
+
system "git --no-pager log --decorate --graph --oneline #{remote}/#{branch} #{remote}/master --not #{remote}/#{branch}^@ --"
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "Display where the central live branch is pointing"
|
29
|
+
task :uptip do
|
30
|
+
sync
|
31
|
+
system %(git --no-pager log --decorate -1 --format="#{remote}'s #{branch} tip is set to: [%h] %s (%an, %ar)" #{remote}/#{branch})
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "A small overview of the deployment procedure"
|
35
|
+
task :help do
|
36
|
+
puts <<-HELP
|
37
|
+
|
38
|
+
Overview:
|
39
|
+
* Deploying the #{branch} branch of #{repository}
|
40
|
+
* The #{branch} branch can be moved *anywhere*.
|
41
|
+
|
42
|
+
Quick help:
|
43
|
+
Go the branch you want to mark as #{branch} (ex. master) and run:
|
44
|
+
cap deploy
|
45
|
+
|
46
|
+
Under the hood:
|
47
|
+
* If being on a branch diffent that #{branch}:
|
48
|
+
git branch -f #{branch} <desired-commit>
|
49
|
+
* Finally send changes to the central repo:
|
50
|
+
git push --force #{remote}} #{branch} (or cap gity:push)
|
51
|
+
* cap deploy
|
52
|
+
|
53
|
+
Troubleshooting:
|
54
|
+
cap gity:uptip # Show the #{branch} branch of the central repo
|
55
|
+
cap gity:status # A log-like view showing important commits
|
56
|
+
|
57
|
+
cap gity:check # check consistency between the applied revision and the one on the #{branch} branch
|
58
|
+
HELP
|
59
|
+
end
|
60
|
+
|
61
|
+
task :uprev do
|
62
|
+
run "cd #{current_path} && cat REVISION"
|
63
|
+
end
|
64
|
+
|
65
|
+
task :check do
|
66
|
+
uprev
|
67
|
+
uptip
|
68
|
+
end
|
69
|
+
|
70
|
+
task :prepare_deploy do
|
71
|
+
push
|
72
|
+
uptip
|
73
|
+
end
|
74
|
+
|
75
|
+
before 'deploy', 'gity:prepare_deploy'
|
76
|
+
|
77
|
+
end
|
78
|
+
end
|
data/test/helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-gity
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Skroutz.gr Team
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-03-02 00:00:00 +02:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description:
|
17
|
+
email: yatiohi@ideopolis.gr
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- LICENSE
|
24
|
+
- README.rdoc
|
25
|
+
files:
|
26
|
+
- .document
|
27
|
+
- .gitignore
|
28
|
+
- LICENSE
|
29
|
+
- README.rdoc
|
30
|
+
- Rakefile
|
31
|
+
- VERSION
|
32
|
+
- lib/capistrano-gity.rb
|
33
|
+
- test/helper.rb
|
34
|
+
- test/test_capistrano-gity.rb
|
35
|
+
has_rdoc: true
|
36
|
+
homepage: http://github.com/ctrochalakis/capistrano-gity
|
37
|
+
licenses: []
|
38
|
+
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options:
|
41
|
+
- --charset=UTF-8
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: "0"
|
49
|
+
version:
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
version:
|
56
|
+
requirements: []
|
57
|
+
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 1.3.5
|
60
|
+
signing_key:
|
61
|
+
specification_version: 3
|
62
|
+
summary: Git helpers for capistrano deployments
|
63
|
+
test_files:
|
64
|
+
- test/test_capistrano-gity.rb
|
65
|
+
- test/helper.rb
|