capistrano-gity 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,21 @@
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/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
@@ -0,0 +1,9 @@
1
+ = capistrano-gity
2
+
3
+ Git deployment helpers for capistrano. Check the module for details :)
4
+
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug fix.
9
+ * Send a pull request.
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
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'capistrano-gity'
8
+
9
+ class Test::Unit::TestCase
10
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestCapistranoGity < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
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