monolith 0.0.0 → 0.0.1
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/README.md +21 -2
- data/bin/monolith +5 -0
- data/lib/monolith/configuration.rb +8 -0
- data/lib/monolith/generator.rb +21 -2
- data/lib/monolith/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db6c09688ad0019814c3b23ff10869891f07e1d4
|
4
|
+
data.tar.gz: 62ab5dc0c6a694f3c9b80ff3e9ed8956122b19a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7838b0e76bfc57b9fcd4285fd895187bb510e3fe91de0f6bbae8f19d9614d26bd4cbb0e1e2f2d61e45724ef77115c285e736a3eda3a9fe38c4b8bb7c598699e
|
7
|
+
data.tar.gz: 285a7eeef38b1385ee8dc917e3cf470162238f0aff7196380de0673ceeebf57cca6e17201f1ab3b3719b6880b27405fd94d8c3c2c403b4c196cdea3355490cb6
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# [](https://github.com/shuber) monolith
|
2
2
|
|
3
|
-
[](http://badge.fury.io/rb/monolith)
|
3
|
+
[](https://codeclimate.com/github/shuber/monolith) [](http://badge.fury.io/rb/monolith)
|
4
4
|
|
5
5
|
Generates a single monolithic repository from a list of other git repositories
|
6
6
|
|
@@ -33,8 +33,27 @@ repositories:
|
|
33
33
|
auth: git@github.com:some-org/your-auth-gem.git
|
34
34
|
users: git@github.com:some-org/users.git
|
35
35
|
|
36
|
-
branches
|
36
|
+
# Optional whitelist of branches to clone. By default,
|
37
|
+
# ALL branches are imported into the monolith.
|
38
|
+
branches:
|
37
39
|
- master
|
40
|
+
|
41
|
+
# Optional list of commands to run right after
|
42
|
+
# all of the repositories above have been cloned.
|
43
|
+
#
|
44
|
+
# These are handy for things like rewriting history
|
45
|
+
# to remove large unused files or sensitive information.
|
46
|
+
after_clone:
|
47
|
+
- ./remove_all_unused_large_files
|
48
|
+
|
49
|
+
# Optional list of commands to run after the monolith
|
50
|
+
# has been generated.
|
51
|
+
#
|
52
|
+
# These hooks are handy for things like introducing new top-level
|
53
|
+
# config files for services like Heroku, CodeClimate, CircleCI, etc.
|
54
|
+
after_generate:
|
55
|
+
- ./add_global_gitignore
|
56
|
+
- ./add_global_slugignore
|
38
57
|
```
|
39
58
|
|
40
59
|
Use the `monolith` command to generate a repository at `/path/to/your/new/monolith`
|
data/bin/monolith
ADDED
data/lib/monolith/generator.rb
CHANGED
@@ -18,17 +18,36 @@ module Monolith
|
|
18
18
|
|
19
19
|
def generate
|
20
20
|
clone
|
21
|
-
create_monolith
|
22
21
|
fetch_all_remotes
|
22
|
+
run_after_clone_hooks
|
23
|
+
create_monolith
|
23
24
|
add_remotes_to_monolith
|
24
25
|
prepare_branches_for_merge
|
25
26
|
merge_branches_into_monolith
|
26
27
|
remove_remotes_from_monolith
|
27
28
|
checkout_master_on_monolith
|
29
|
+
run_after_generate_hooks
|
28
30
|
end
|
29
31
|
|
30
32
|
private
|
31
33
|
|
34
|
+
def run_after_clone_hooks
|
35
|
+
@monolith.config.after_clone_hooks.each do |hook|
|
36
|
+
run_hook(hook)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def run_after_generate_hooks
|
41
|
+
@monolith.config.after_generate_hooks.each do |hook|
|
42
|
+
run_hook(hook)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def run_hook(hook)
|
47
|
+
log("Running hook #{hook.inspect}")
|
48
|
+
system(hook, @monolith.config.path, *branches)
|
49
|
+
end
|
50
|
+
|
32
51
|
def create_monolith
|
33
52
|
log("Generating monolith #{name.red}")
|
34
53
|
@monolith.create
|
@@ -83,7 +102,7 @@ module Monolith
|
|
83
102
|
end
|
84
103
|
|
85
104
|
def branches
|
86
|
-
filtered_branches.sort
|
105
|
+
@branches ||= filtered_branches.sort
|
87
106
|
end
|
88
107
|
|
89
108
|
def filtered_branches
|
data/lib/monolith/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monolith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Huber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocaine
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- Gemfile.lock
|
93
93
|
- LICENSE
|
94
94
|
- README.md
|
95
|
+
- bin/monolith
|
95
96
|
- lib/monolith.rb
|
96
97
|
- lib/monolith/application.rb
|
97
98
|
- lib/monolith/branch.rb
|
@@ -140,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
141
|
version: '0'
|
141
142
|
requirements: []
|
142
143
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
144
|
+
rubygems_version: 2.2.5
|
144
145
|
signing_key:
|
145
146
|
specification_version: 4
|
146
147
|
summary: Monolithic git repository generator
|