capistrano-monorepo 0.0.1 → 0.0.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67183f0269d28340cd27f8e28bab6f3c78cf8487fe3c5ca44f3d42b951e99971
|
4
|
+
data.tar.gz: 5ce9b49daedf10ab1dcc5b45739d4bece0920c00f28b331bfcac7761a995e115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae1d4aab3c7d5398176d07d5ea6920aa0497d3035bddfca6edd3ff7bb6bd50ecb77d476413fc8ee7137a3f8b7cc48d3926c5e6076ad9c266277565e38c83112e
|
7
|
+
data.tar.gz: ceb844ad0966529fd01108919423e9412e91eb2345a402d6efb2d285e87d115ba9bbb714be3d81af8e7cf0a75e2815664b4a487e4556388e8441f20e3a3c7cfa
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Johnson
|
@@ -74,14 +74,10 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- lib/capistrano-monorepo.rb
|
77
|
-
- lib/capistrano-monorepoassets.rb
|
78
77
|
- lib/capistrano/monorepo.rb
|
79
78
|
- lib/capistrano/monorepo/assets.rb
|
80
79
|
- lib/capistrano/monorepo/version.rb
|
81
|
-
- lib/capistrano/monorepoassets.rb
|
82
|
-
- lib/capistrano/monorepoassets/version.rb
|
83
80
|
- lib/capistrano/tasks/assets.rake
|
84
|
-
- lib/capistrano/tasks/import-assets.rake
|
85
81
|
homepage: https://github.com/foamfactory/capistrano-monorepo
|
86
82
|
licenses:
|
87
83
|
- MPL-2.0
|
File without changes
|
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'pathname'
|
2
|
-
|
3
|
-
##
|
4
|
-
# Import assets from a top level monorepo directory into the current working
|
5
|
-
# directory.
|
6
|
-
#
|
7
|
-
# When you use :repo_tree to deploy a specific directory of a monorepo, but your
|
8
|
-
# asset repository is in a different directory, you need to check out this
|
9
|
-
# top-level directory and add it to the deployment path. For example, if your
|
10
|
-
# monorepo directory structure looks something like:
|
11
|
-
#
|
12
|
-
# - /app
|
13
|
-
# - src/
|
14
|
-
# - assets -> symlink to ../../assets
|
15
|
-
# - /assets
|
16
|
-
# - /api
|
17
|
-
#
|
18
|
-
# And you want to deploy /app, the symlink to the upper directory won't exist if
|
19
|
-
# capistrano is configured to use :repo_tree "app". In order to overcome this,
|
20
|
-
# this task checks out a specified piece of the larger monorepo (in this case,
|
21
|
-
# the assets directory), and places it in the deployment directory at a
|
22
|
-
# specified location.
|
23
|
-
#
|
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).
|
33
|
-
#
|
34
|
-
# In the above example, you would specify:
|
35
|
-
#
|
36
|
-
# set :asset_path, "src/assets"
|
37
|
-
# set :asset_source, "assets"
|
38
|
-
#
|
39
|
-
namespace :monorepo do
|
40
|
-
desc "Import assets from a top-level monorepo directory"
|
41
|
-
task :import_assets do
|
42
|
-
on roles(:all) do |host|
|
43
|
-
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
|
51
|
-
|
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)}"
|
55
|
-
|
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}"
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|