capistrano-simplegit 0.0.5 → 0.0.6
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/capistrano-simplegit.gemspec +1 -1
- data/lib/capistrano/tasks/simplegit.rake +18 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46049bdab782dc9e6f9f997338b11e5f194d19c2
|
4
|
+
data.tar.gz: cf217e0e381a2fc499457e13d6714e9850fe2207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50b7cd3738ed6a37f76088bed0cb8f58da7595ca192fc9d97525974972e7471a22e1d656a90f857c62561d015b488a02241dab939e02fb6b72d08c859dc6670f
|
7
|
+
data.tar.gz: 1137322c4125ccfde50c10456a583c5e09af3160847ead61298098e60280fbc7445650594b81cc2d44aa38dcdc3e8d547ef14012c2afb0c390f22ce3295313d5
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'capistrano-simplegit'
|
6
|
-
spec.version = '0.0.
|
6
|
+
spec.version = '0.0.6'
|
7
7
|
spec.authors = ['Ross Riley']
|
8
8
|
spec.email = ['riley.ross@gmail.com']
|
9
9
|
spec.description = %q{A simple Git Deploy Command for Capistrano 3.x}
|
@@ -4,10 +4,10 @@ namespace :simplegit do
|
|
4
4
|
task :deploy do
|
5
5
|
|
6
6
|
on roles :all do
|
7
|
-
info "--> Deploy from #{fetch(:
|
7
|
+
info "--> Deploy from #{fetch(:simplegit_repo)} on branch #{fetch(:simplegit_branch)}"
|
8
8
|
|
9
9
|
begin
|
10
|
-
execute "ls #{fetch(:
|
10
|
+
execute "ls #{fetch(:simplegit_deploy)}/.git"
|
11
11
|
rescue
|
12
12
|
invoke 'simplegit:prepare'
|
13
13
|
end
|
@@ -15,16 +15,16 @@ namespace :simplegit do
|
|
15
15
|
info "--> Updating code from remote repository"
|
16
16
|
|
17
17
|
begin
|
18
|
-
execute "cd #{fetch(:
|
18
|
+
execute "cd #{fetch(:simplegit_deploy)} && git fetch"
|
19
19
|
rescue
|
20
20
|
error "Unable to connect to remote repository, check your configuration, and that a valid ssh key exists for remote server."
|
21
21
|
exit
|
22
22
|
end
|
23
23
|
|
24
24
|
begin
|
25
|
-
execute "cd #{fetch(:
|
25
|
+
execute "cd #{fetch(:simplegit_deploy)} && git show-branch #{fetch(:simplegit_branch)} && git checkout #{fetch(:simplegit_branch)} ; git reset --hard origin/#{fetch(:simplegit_branch)}"
|
26
26
|
rescue
|
27
|
-
execute "cd #{fetch(:
|
27
|
+
execute "cd #{fetch(:simplegit_deploy)} && git checkout -b #{fetch(:simplegit_branch)} origin/#{fetch(:simplegit_branch)} ;"
|
28
28
|
end
|
29
29
|
execute "git submodule update --init --recursive"
|
30
30
|
end
|
@@ -33,9 +33,20 @@ namespace :simplegit do
|
|
33
33
|
desc 'Performs the initial setup and fetch of the repo'
|
34
34
|
task :prepare do
|
35
35
|
on roles :all do
|
36
|
-
execute "cd #{fetch(:
|
37
|
-
execute "cd #{fetch(:
|
36
|
+
execute "cd #{fetch(:simplegit_deploy)} && git init"
|
37
|
+
execute "cd #{fetch(:simplegit_deploy)} && git remote add origin #{fetch(:simplegit_repo)}"
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
end
|
42
|
+
|
43
|
+
namespace :load do
|
44
|
+
|
45
|
+
task :defaults do
|
46
|
+
set :simplegit_deploy, -> { fetch(:deploy_to) }
|
47
|
+
set :simplegit_repo, -> { fetch(:repo_url) }
|
48
|
+
set :simplegit_branch, -> { fetch(:branch) }
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|