oxen_deployer_git 1.0.4 → 1.0.7

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.
Files changed (2) hide show
  1. data/lib/oxen_deployer/git.rb +52 -42
  2. metadata +2 -2
@@ -1,7 +1,7 @@
1
1
  class OxenDeployer::Git
2
2
 
3
3
  # Duh.
4
- VERSION = "1.0.4"
4
+ VERSION = "1.0.7"
5
5
 
6
6
  set :source, OxenDeployer::Git.new
7
7
  set :git_cmd, "git"
@@ -14,47 +14,57 @@ class OxenDeployer::Git
14
14
  destination = File.join(destination, 'repo')
15
15
  revision = 'HEAD' if revision =~ /head/i
16
16
  new_revision = ('HEAD' == revision) ? "origin" : revision
17
-
18
- if fast_checkout_applicable?(revision, destination)
19
- [ "cd #{destination}",
20
- "#{git_cmd} checkout #{revision}",
21
- "#{git_cmd} fetch",
22
- "#{git_cmd} reset --hard #{new_revision}",
23
- submodule_cmd,
24
- "#{git_cmd} branch -f deployed-#{revision} #{revision}",
25
- "#{git_cmd} checkout deployed-#{revision}",
26
- "cd -"
27
- ].join(" && ")
28
- # [ "cd #{destination}",
29
- # "#{git_cmd} checkout -q origin",
30
- # "#{git_cmd} fetch",
31
- # "#{git_cmd} reset --hard #{new_revision}",
32
- # submodule_cmd,
33
- # "#{git_cmd} branch -f deployed-#{revision} #{revision}",
34
- # "#{git_cmd} checkout deployed-#{revision}",
35
- # "cd -"
36
- # ].join(" && ")
37
- else
38
- [ "rm -rf #{destination}",
39
- "mkdir -p #{destination}",
40
- "cd #{destination}",
41
- "#{git_cmd} init",
42
- "#{git_cmd} remote add -t #{revision} -f origin #{repository}",
43
- "#{git_cmd} checkout #{revision}",
44
- "#{git_cmd} checkout -b deployed-#{revision}",
45
- submodule_cmd,
46
- "cd -"
47
- ].join(" && ")
48
- #
49
- #
50
- # [ "rm -rf #{destination}",
51
- # "#{git_cmd} clone #{repository} #{destination}",
52
- # "cd #{destination}",
53
- # "#{git_cmd} checkout -f -b deployed-#{revision} #{revision}",
54
- # submodule_cmd,
55
- # "cd -"
56
- # ].join(" && ")
57
- end
17
+
18
+ [ "cd #{destination}",
19
+ "#{git_cmd} checkout #{revision}",
20
+ "#{git_cmd} branch -D deployed-#{revision}",
21
+ "#{git_cmd} pull",
22
+ "#{git_cmd} branch deployed-#{revision} #{revision}",
23
+ "#{git_cmd} checkout deployed-#{revision}",
24
+ "cd -"
25
+ ].join( " && ")
26
+ # if fast_checkout_applicable?(revision, destination)
27
+ # [ "cd #{destination}",
28
+ # "#{git_cmd} checkout #{revision}",
29
+ # "#{git_cmd} fetch",
30
+ # "#{git_cmd} reset --hard #{new_revision}",
31
+ # submodule_cmd,
32
+ # "#{git_cmd} branch -D deployed-#{revision}",
33
+ # "#{git_cmd} branch deployed-#{revision} #{revision}",
34
+ # "#{git_cmd} checkout deployed-#{revision}",
35
+ # "cd -"
36
+ # ].join(" && ")
37
+ # # [ "cd #{destination}",
38
+ # # "#{git_cmd} checkout -q origin",
39
+ # # "#{git_cmd} fetch",
40
+ # # "#{git_cmd} reset --hard #{new_revision}",
41
+ # # submodule_cmd,
42
+ # # "#{git_cmd} branch -f deployed-#{revision} #{revision}",
43
+ # # "#{git_cmd} checkout deployed-#{revision}",
44
+ # # "cd -"
45
+ # # ].join(" && ")
46
+ # else
47
+ # [ "rm -rf #{destination}",
48
+ # "mkdir -p #{destination}",
49
+ # "cd #{destination}",
50
+ # "#{git_cmd} init",
51
+ # "#{git_cmd} remote add -t #{revision} -f origin #{repository}",
52
+ # "#{git_cmd} checkout #{revision}",
53
+ # "#{git_cmd} branch -D deployed-#{revision}",
54
+ # "#{git_cmd} checkout -b deployed-#{revision}",
55
+ # submodule_cmd,
56
+ # "cd -"
57
+ # ].join(" && ")
58
+ # #
59
+ # #
60
+ # # [ "rm -rf #{destination}",
61
+ # # "#{git_cmd} clone #{repository} #{destination}",
62
+ # # "cd #{destination}",
63
+ # # "#{git_cmd} checkout -f -b deployed-#{revision} #{revision}",
64
+ # # submodule_cmd,
65
+ # # "cd -"
66
+ # # ].join(" && ")
67
+ # end
58
68
  end
59
69
 
60
70
  # Returns the command that will export +revision+ from the current
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxen_deployer_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-10-15 00:00:00.000000000 Z
13
+ date: 2013-12-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: oxen_deployer