capistrano-monorepo 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77e078beb3a163d6d4ed4774aa928455bb67a6be11996fe6348efbb0fc5e1cfc
4
- data.tar.gz: 926e6ad818142845885370f20e5e881d897b0a4968ced7177852959595e32c28
3
+ metadata.gz: 0aaa63a8ca4a4171ad7c71519db6ff19e644b24c63e1fbab7dc6045082bc5de2
4
+ data.tar.gz: 22cd879db6bd8957068a476cd0816b36fe19341dcac20d346cda3e36c2a18175
5
5
  SHA512:
6
- metadata.gz: c02e2b4d8ca34a2b6e9d63a28b0adbf3c10ae76b770396b65e2faf209ebf56779ec187ab75e28445a659479db310d11c439b5c36f1d2d10e1241795cd0f58a38
7
- data.tar.gz: 18af6a5aa1e604b22f8524188d552a8aa6d67cd6a9706a5732c436f144a429aec2810902baabe537ae6a93ecfe3ae4eeb77da109c736fb1ff6677dccbe5dc613
6
+ metadata.gz: fe22d5250b6ed2e149b17a31234665357807fc0b1a722aea117ded18e90bb2131366f150e546735fd536665a907ca5a543e7f5b030afd565ea072fcf6f1118a8
7
+ data.tar.gz: 6eb5517e70c2cff5a0d0d16b208bf7457532ca6d011521fc6cf42dc8837389dd439090e03026017ad1f9061589e3417d4352515fff84e5cef8d9e1ca60e11389
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Monorepo
3
- VERSION = '0.0.3'.freeze
3
+ VERSION = '0.0.4'.freeze
4
4
  end
5
5
  end
@@ -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 two variables:
26
- # - :asset_path - The location within the deployment directory where the
27
- # assets should be placed. Relative to the deployment working
28
- # directory.
29
- # - :asset_source - The location of the top-level asset folder in the
30
- # monorepo. Relative to the top level of the monorepo (i.e.
31
- # the directory that would be used as a deployment if
32
- # :repo_tree was not specified).
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 :asset_path, "src/assets"
37
- # set :asset_source, "assets"
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
- final_asset_location = "#{release_path}/#{fetch(:asset_path)}"
45
- asset_stat_result = capture "stat", "-t", "#{final_asset_location}"
46
- asset_stat_result = asset_stat_result.split(" ")
47
- if asset_stat_result[0] == "#{final_asset_location}"
48
- info "Removing existing asset directory #{final_asset_location}..."
49
- execute "rm", "-rf", "#{final_asset_location}"
50
- end
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
- source_dir = Pathname.new(final_asset_location).parent.to_s
53
- info "Importing assets to #{source_dir}/#{fetch(:asset_source)}"
54
- execute "GIT_WORK_TREE=#{source_dir}", :git, "checkout", "#{fetch(:branch)}", "--", "#{fetch(:asset_source)}"
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
- info "Moving asset directory #{source_dir}/#{fetch(:asset_source)} to #{final_asset_location}..."
57
- execute :mv, "#{source_dir}/#{fetch(:asset_source)}", "#{final_asset_location}"
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.3
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: 2019-08-15 00:00:00.000000000 Z
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.4
100
+ rubygems_version: 3.0.8
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: Capistrano plugin for working with monorepos