capistrano-git-copy-bundle 0.1.0 → 0.2.0
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/CHANGELOG.md +4 -0
- data/lib/capistrano/git_copy/bundle.rb +0 -1
- data/lib/capistrano/git_copy/bundle/task.rb +1 -1
- data/lib/capistrano/git_copy/bundle/tasks/{bundle.cap → bundle.rake} +6 -5
- data/lib/capistrano/git_copy/bundle/utility.rb +35 -12
- data/lib/capistrano/git_copy/bundle/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df61315e329e8b5892b56b025b5f525e18224743
|
4
|
+
data.tar.gz: e1282409da8e80ebb2d9369db3dd555626230f03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28d78d5ec7401ec119edcdb6aa95538afbe3ee5f6a9dad42627e71b5d4b5b242a2f2d2d1b00094dd7644f5b350b822dc79387f53670520411605cea7c5499b29
|
7
|
+
data.tar.gz: 73db3645f17321fd485959c505bb0185655b253a53fa7014770b24db417b9d1c0123ffaf34508d04c0d7c59ac3a14bb64a20117e9382d71ffdc21e79f91392a7
|
data/CHANGELOG.md
CHANGED
@@ -1 +1 @@
|
|
1
|
-
load File.expand_path('../tasks/bundle.
|
1
|
+
load File.expand_path('../tasks/bundle.rake', __FILE__)
|
@@ -1,3 +1,7 @@
|
|
1
|
+
def git_copy_bundle_utility
|
2
|
+
@_git_copy_bundle_utility ||= Capistrano::GitCopy::Bundle::Utility.new(self)
|
3
|
+
end
|
4
|
+
|
1
5
|
namespace :load do
|
2
6
|
task :defaults do
|
3
7
|
set :bundle_flags, "#{fetch(:bundle_flags)} --local"
|
@@ -6,17 +10,14 @@ end
|
|
6
10
|
|
7
11
|
namespace :git_copy do
|
8
12
|
namespace :bundle do
|
9
|
-
def git_copy_bundle_utility
|
10
|
-
@git_copy_bundle_utility ||= Capistrano::GitCopy::Bundle::Utility.new(self)
|
11
|
-
end
|
12
|
-
|
13
13
|
task upload: :'git_copy:bundle:cache' do
|
14
14
|
on release_roles :all do
|
15
15
|
git_copy_bundle_utility.upload
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
|
19
|
+
desc 'Cache bundled gems'
|
20
|
+
task :cache do
|
20
21
|
run_locally do
|
21
22
|
git_copy_bundle_utility.cache
|
22
23
|
end
|
@@ -1,24 +1,24 @@
|
|
1
|
-
require '
|
1
|
+
require 'fileutils'
|
2
|
+
require 'digest/md5'
|
2
3
|
|
3
4
|
module Capistrano
|
4
5
|
module GitCopy
|
5
6
|
module Bundle
|
6
|
-
# Utility stuff to avoid cluttering of bundle.
|
7
|
-
class Utility
|
7
|
+
# Utility stuff to avoid cluttering of bundle.rake
|
8
|
+
class Utility
|
9
|
+
def initialize(context)
|
10
|
+
@context = context
|
11
|
+
end
|
12
|
+
|
8
13
|
# Cache used gems
|
9
14
|
#
|
10
15
|
# @return void
|
11
16
|
def cache
|
12
|
-
local_vendor_path = File.join(repo_path, 'vendor')
|
13
|
-
|
14
17
|
execute(:mkdir, '-p', local_cache_path) unless test!("[ -d #{local_cache_path} ]")
|
15
|
-
execute(:mkdir, '-p', local_vendor_path) unless test!("[ -d #{local_vendor_path} ]")
|
16
|
-
|
17
|
-
execute(:ln, '-s', local_cache_path, File.join(local_vendor_path, 'cache'))
|
18
18
|
|
19
19
|
if gems_changed?
|
20
20
|
Bundler.with_clean_env do
|
21
|
-
execute("bundle package --gemfile #{File.join(
|
21
|
+
execute("bundle package --gemfile #{File.join(Dir.pwd, 'Gemfile')} --all --all-platforms")
|
22
22
|
end
|
23
23
|
|
24
24
|
File.open(cached_gemfile_md5_path, 'w') { |f| f.write(gemfile_md5) } unless gemfile_md5.nil?
|
@@ -48,6 +48,7 @@ module Capistrano
|
|
48
48
|
# @return void
|
49
49
|
def clear_local
|
50
50
|
execute(:rm, '-rf', File.join(local_cache_path, '*')) if test!("[ -d #{local_cache_path} ]")
|
51
|
+
|
51
52
|
File.unlink(cached_gemfile_md5_path)
|
52
53
|
end
|
53
54
|
|
@@ -69,14 +70,14 @@ module Capistrano
|
|
69
70
|
#
|
70
71
|
# @return [String]
|
71
72
|
def local_cache_path
|
72
|
-
File.join(
|
73
|
+
File.join(Dir.pwd, 'vendor', 'cache')
|
73
74
|
end
|
74
75
|
|
75
76
|
# MD5 sum of Gemfile.lock to deploy
|
76
77
|
#
|
77
78
|
# @return [String]
|
78
79
|
def gemfile_md5
|
79
|
-
@_gemfile_md5 ||= Digest::MD5.file(File.join(
|
80
|
+
@_gemfile_md5 ||= Digest::MD5.file(File.join(Dir.pwd, 'Gemfile.lock')).hexdigest rescue nil
|
80
81
|
end
|
81
82
|
|
82
83
|
# MD5 sum of Gemfile.lock for local gem cache
|
@@ -90,7 +91,7 @@ module Capistrano
|
|
90
91
|
#
|
91
92
|
# @return [String]
|
92
93
|
def cached_gemfile_md5_path
|
93
|
-
File.join(
|
94
|
+
File.join(Dir.pwd, '.capistrano-git-copy-bundle-gemfile-lock.md5')
|
94
95
|
end
|
95
96
|
|
96
97
|
# Checks if Gemfile.lock has changed since last deploy
|
@@ -106,6 +107,28 @@ module Capistrano
|
|
106
107
|
def local_gems
|
107
108
|
%x(ls #{local_cache_path}).split(/\s+/)
|
108
109
|
end
|
110
|
+
|
111
|
+
private
|
112
|
+
|
113
|
+
def fetch(*args)
|
114
|
+
@context.fetch(*args)
|
115
|
+
end
|
116
|
+
|
117
|
+
def execute(*args)
|
118
|
+
@context.execute(*args)
|
119
|
+
end
|
120
|
+
|
121
|
+
def capture(*args)
|
122
|
+
@context.capture(*args)
|
123
|
+
end
|
124
|
+
|
125
|
+
def test!(*args)
|
126
|
+
@context.test(*args)
|
127
|
+
end
|
128
|
+
|
129
|
+
def upload!(*args)
|
130
|
+
@context.upload!(*args)
|
131
|
+
end
|
109
132
|
end
|
110
133
|
end
|
111
134
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-git-copy-bundle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Schwab
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,7 +97,7 @@ files:
|
|
97
97
|
- capistrano-git-copy-bundle.gemspec
|
98
98
|
- lib/capistrano/git_copy/bundle.rb
|
99
99
|
- lib/capistrano/git_copy/bundle/task.rb
|
100
|
-
- lib/capistrano/git_copy/bundle/tasks/bundle.
|
100
|
+
- lib/capistrano/git_copy/bundle/tasks/bundle.rake
|
101
101
|
- lib/capistrano/git_copy/bundle/utility.rb
|
102
102
|
- lib/capistrano/git_copy/bundle/version.rb
|
103
103
|
homepage: https://github.com/ydkn/capistrano-git-copy-bundle
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.6.11
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Packages gems locally and uploads them to the remote server instead of fetching
|