capistrano-monorepo 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano/monorepo/version.rb +1 -1
- data/lib/capistrano/tasks/assets.rake +30 -22
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aaa63a8ca4a4171ad7c71519db6ff19e644b24c63e1fbab7dc6045082bc5de2
|
4
|
+
data.tar.gz: 22cd879db6bd8957068a476cd0816b36fe19341dcac20d346cda3e36c2a18175
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe22d5250b6ed2e149b17a31234665357807fc0b1a722aea117ded18e90bb2131366f150e546735fd536665a907ca5a543e7f5b030afd565ea072fcf6f1118a8
|
7
|
+
data.tar.gz: 6eb5517e70c2cff5a0d0d16b208bf7457532ca6d011521fc6cf42dc8837389dd439090e03026017ad1f9061589e3417d4352515fff84e5cef8d9e1ca60e11389
|
@@ -22,39 +22,47 @@ require 'pathname'
|
|
22
22
|
# specified location.
|
23
23
|
#
|
24
24
|
# Configuration:
|
25
|
-
# In your deploy/<stage>.rb file, you will need to specify
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
25
|
+
# In your deploy/<stage>.rb file, you will need to specify a variable
|
26
|
+
# `:monorepo_asset_paths` that contains an array of objects. Each of
|
27
|
+
# these objects must contain the following variables:
|
28
|
+
# - asset_path - The location within the deployment directory where the
|
29
|
+
# assets should be placed. Relative to the deployment working
|
30
|
+
# directory.
|
31
|
+
# - asset_source - The location of the top-level asset folder in the
|
32
|
+
# monorepo. Relative to the top level of the monorepo (i.e.
|
33
|
+
# the directory that would be used as a deployment if
|
34
|
+
# :repo_tree was not specified).
|
33
35
|
#
|
34
36
|
# In the above example, you would specify:
|
35
37
|
#
|
36
|
-
# set :
|
37
|
-
#
|
38
|
+
# set :monorepo_asset_paths, [
|
39
|
+
# {
|
40
|
+
# asset_path: "src/assets",
|
41
|
+
# asset_source: "assets"
|
42
|
+
# }
|
43
|
+
# ]
|
38
44
|
#
|
39
45
|
namespace :monorepo do
|
40
46
|
desc "Import assets from a top-level monorepo directory"
|
41
47
|
task :import_assets do
|
42
48
|
on roles(:all) do |host|
|
43
49
|
within repo_path do
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
50
|
+
fetch(:monorepo_asset_paths).each { |asset|
|
51
|
+
final_asset_location = "#{release_path}/#{asset[:asset_path]}"
|
52
|
+
asset_stat_result = capture "stat", "-t", "#{final_asset_location}"
|
53
|
+
asset_stat_result = asset_stat_result.split(" ")
|
54
|
+
if asset_stat_result[0] == "#{final_asset_location}"
|
55
|
+
info "Removing existing asset directory #{final_asset_location}..."
|
56
|
+
execute "rm", "-rf", "#{final_asset_location}"
|
57
|
+
end
|
51
58
|
|
52
|
-
|
53
|
-
|
54
|
-
|
59
|
+
source_dir = Pathname.new(final_asset_location).parent.to_s
|
60
|
+
info "Importing assets to #{source_dir}/#{asset[:asset_source]}"
|
61
|
+
execute "GIT_WORK_TREE=#{source_dir}", :git, "checkout", "#{fetch(:branch)}", "--", "#{asset[:asset_source]}"
|
55
62
|
|
56
|
-
|
57
|
-
|
63
|
+
info "Moving asset directory #{source_dir}/#{asset[:asset_source]} to #{final_asset_location}..."
|
64
|
+
execute :mv, "#{source_dir}/#{asset[:asset_source]}", "#{final_asset_location}"
|
65
|
+
}
|
58
66
|
end
|
59
67
|
end
|
60
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-monorepo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
rubygems_version: 3.0.
|
100
|
+
rubygems_version: 3.0.8
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: Capistrano plugin for working with monorepos
|