git-runner-deploy 0.1.1 → 0.1.2

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.
@@ -16,5 +16,5 @@ Gem::Specification.new do |gem|
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.require_paths = ["lib"]
18
18
 
19
- gem.add_dependency 'git-runner', '>= 0.1.1'
19
+ gem.add_dependency 'git-runner', '>= 0.1.2'
20
20
  end
@@ -7,7 +7,7 @@ module GitRunner
7
7
 
8
8
  # Performs deployments using capistrano (cap deploy)
9
9
  class Deploy < Base
10
- VERSION = '0.1.1'
10
+ VERSION = '0.1.2'
11
11
 
12
12
  attr_accessor :clone_directory
13
13
 
@@ -27,7 +27,6 @@ module GitRunner
27
27
  ensure_presence_of_capfile
28
28
  prepare_deploy_environment
29
29
  perform_deploy
30
- cleanup_deploy_environment
31
30
 
32
31
  end_time = Time.now
33
32
 
@@ -63,13 +62,23 @@ module GitRunner
63
62
 
64
63
  def checkout_branch
65
64
  timestamp = Time.now.strftime("%Y%m%d%H%M%S")
66
- self.clone_directory = File.join(Configuration.tmp_directory, "#{branch.repository_name}-#{environment_from_branch(branch)}-#{timestamp}")
65
+ self.clone_directory = File.join(Configuration.tmp_directory, "#{branch.repository_name}")
67
66
 
68
- Text.out("Checking out #{branch.name} to #{clone_directory}")
67
+ if File.exist?(clone_directory)
68
+ Text.out("Checking out #{branch.name} to #{clone_directory}")
69
+ else
70
+ Text.out("Checking out #{branch.name} to #{clone_directory} (fresh clone)")
71
+
72
+ execute(
73
+ "mkdir -p #{clone_directory}",
74
+ "git clone file://#{branch.repository_path} #{clone_directory}"
75
+ )
76
+ end
69
77
 
70
78
  execute(
71
- "mkdir -p #{clone_directory}",
72
- "git clone --depth=1 --branch=#{branch.name} file://#{branch.repository_path} #{clone_directory}"
79
+ "cd #{clone_directory}",
80
+ "git checkout #{branch.name}",
81
+ "git pull"
73
82
  )
74
83
  end
75
84
 
@@ -79,7 +88,7 @@ module GitRunner
79
88
  if uses_bundler?
80
89
  execute(
81
90
  "cd #{clone_directory}",
82
- "bundle install --path=#{File.join(Configuration.tmp_directory, '.gems')}"
91
+ "bundle install --path=.git-runner/gems"
83
92
  )
84
93
  end
85
94
  end
@@ -116,14 +125,6 @@ module GitRunner
116
125
  end
117
126
  end
118
127
 
119
- def cleanup_deploy_environment
120
- Text.out("Cleaning deploy environment")
121
- execute(
122
- "rm -rf #{clone_directory}",
123
- "cd #{branch.repository_path}"
124
- )
125
- end
126
-
127
128
  def environment_from_branch(branch)
128
129
  if branch.name == 'master'
129
130
  'production'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-runner-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.1.1
21
+ version: 0.1.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.1.1
29
+ version: 0.1.2
30
30
  description: Capistrano deploy module for git-runner
31
31
  email:
32
32
  - james@jamesbrooks.net