modulesync 1.1.0 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.config/cucumber.yml +1 -0
- data/.gitignore +9 -3
- data/.rubocop.yml +8 -1
- data/.rubocop_todo.yml +1 -1
- data/.travis.yml +7 -6
- data/CHANGELOG.md +71 -0
- data/Gemfile +5 -1
- data/HISTORY.md +227 -0
- data/README.md +42 -17
- data/Rakefile +24 -0
- data/features/cli.feature +11 -6
- data/features/hook.feature +3 -5
- data/features/step_definitions/git_steps.rb +63 -35
- data/features/support/env.rb +4 -0
- data/features/update.feature +160 -339
- data/features/update/bad_context.feature +26 -0
- data/lib/modulesync.rb +66 -48
- data/lib/modulesync/cli.rb +13 -7
- data/lib/modulesync/cli/thor.rb +24 -0
- data/lib/modulesync/git.rb +1 -1
- data/lib/modulesync/pr/github.rb +57 -0
- data/lib/modulesync/pr/gitlab.rb +54 -0
- data/lib/modulesync/util.rb +4 -1
- data/lib/monkey_patches.rb +9 -48
- data/modulesync.gemspec +5 -4
- data/spec/helpers/faker.rb +14 -0
- data/spec/helpers/faker/puppet_module_remote_repo.rb +140 -0
- data/spec/unit/modulesync/pr/github_spec.rb +49 -0
- data/spec/unit/modulesync/pr/gitlab_spec.rb +81 -0
- data/spec/unit/modulesync_spec.rb +5 -52
- metadata +42 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb584b8ba14d3c54ae9cf5ca91f24e8d1a087e73e45d98e45e79a29f6bbf2578
|
4
|
+
data.tar.gz: c7fcf27f5bd05249da092a80a92b03430909a400b65c8be53671e2ae4a020459
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b41beb1d73df97a4e006749788f0c6415f8d87c8e7d69cb07a7f74d202bfda4cf238558060d04044080c9b83b71633d182db506820634b92f86887329169b212
|
7
|
+
data.tar.gz: 38f81a8fe37ff9b30f01f59299deb6de1d47ea03c89ea0d0d6df89b83b19f323b1ecaeab349ca7697bff37d9b9b4c7984c1f63083e22c2d721925a93c0d29559
|
@@ -0,0 +1 @@
|
|
1
|
+
default: --publish-quiet
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
3
|
AllCops:
|
4
|
-
TargetRubyVersion: 2.
|
4
|
+
TargetRubyVersion: 2.4
|
5
5
|
Exclude:
|
6
6
|
- 'vendor/**/*'
|
7
7
|
- 'tmp/**/*'
|
8
8
|
- 'pkg/**/*'
|
9
9
|
- 'lib/monkey_patches.rb'
|
10
10
|
- 'spec/**/*'
|
11
|
+
- 'Gemfile'
|
12
|
+
- 'Rakefile'
|
11
13
|
|
12
14
|
Style/HashSyntax:
|
13
15
|
Enabled: false
|
@@ -23,3 +25,8 @@ Layout/IndentHeredoc:
|
|
23
25
|
# sane line length
|
24
26
|
Metrics/LineLength:
|
25
27
|
Max: 120
|
28
|
+
Exclude:
|
29
|
+
- 'features/**/*'
|
30
|
+
|
31
|
+
Style/FrozenStringLiteralComment:
|
32
|
+
Enabled: false
|
data/.rubocop_todo.yml
CHANGED
data/.travis.yml
CHANGED
@@ -2,19 +2,20 @@
|
|
2
2
|
sudo: false
|
3
3
|
language: ruby
|
4
4
|
cache: bundler
|
5
|
-
dist:
|
5
|
+
dist: focal
|
6
6
|
script: 'bundle exec rake test'
|
7
|
+
bundler_args: --without release
|
7
8
|
rvm:
|
8
|
-
- 2.0
|
9
|
-
- 2.1
|
10
|
-
- 2.2
|
11
|
-
- 2.3
|
12
|
-
- 2.4
|
13
9
|
- 2.5
|
14
10
|
- 2.6
|
15
11
|
- 2.7
|
16
12
|
notifications:
|
17
13
|
email: false
|
14
|
+
irc:
|
15
|
+
on_success: always
|
16
|
+
on_failure: always
|
17
|
+
channels:
|
18
|
+
- "chat.freenode.org#voxpupuli-notifications"
|
18
19
|
deploy:
|
19
20
|
provider: rubygems
|
20
21
|
api_key:
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,73 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
## [2.0.2](https://github.com/voxpupuli/modulesync/tree/2.0.2) (2021-04-03)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.0.1...2.0.2)
|
8
|
+
|
9
|
+
**Fixed bugs:**
|
10
|
+
|
11
|
+
- Fix language-dependent Git output handling [\#200](https://github.com/voxpupuli/modulesync/pull/200) ([neomilium](https://github.com/neomilium))
|
12
|
+
|
13
|
+
**Closed issues:**
|
14
|
+
|
15
|
+
- Add linting \(rubocop\) to Travis CI configuration [\#153](https://github.com/voxpupuli/modulesync/issues/153)
|
16
|
+
- Language sensitive GIT handling [\#85](https://github.com/voxpupuli/modulesync/issues/85)
|
17
|
+
|
18
|
+
**Merged pull requests:**
|
19
|
+
|
20
|
+
- Fix spelling of PR CLI option \(kebab-case\) [\#209](https://github.com/voxpupuli/modulesync/pull/209) ([bittner](https://github.com/bittner))
|
21
|
+
- Correctly state which config file to update [\#208](https://github.com/voxpupuli/modulesync/pull/208) ([bittner](https://github.com/bittner))
|
22
|
+
- Fix exit status code on failures [\#204](https://github.com/voxpupuli/modulesync/pull/204) ([neomilium](https://github.com/neomilium))
|
23
|
+
- Remove monkey patches [\#203](https://github.com/voxpupuli/modulesync/pull/203) ([neomilium](https://github.com/neomilium))
|
24
|
+
- Improve tests capabilities by using local/fake remote repositories [\#202](https://github.com/voxpupuli/modulesync/pull/202) ([neomilium](https://github.com/neomilium))
|
25
|
+
- Minor modernization and cosmetic fix [\#201](https://github.com/voxpupuli/modulesync/pull/201) ([neomilium](https://github.com/neomilium))
|
26
|
+
|
27
|
+
## [2.0.1](https://github.com/voxpupuli/modulesync/tree/2.0.1) (2020-10-06)
|
28
|
+
|
29
|
+
[Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.0.0...2.0.1)
|
30
|
+
|
31
|
+
**Fixed bugs:**
|
32
|
+
|
33
|
+
- Use remote\_branch for PRs when specified [\#194](https://github.com/voxpupuli/modulesync/pull/194) ([raphink](https://github.com/raphink))
|
34
|
+
|
35
|
+
**Merged pull requests:**
|
36
|
+
|
37
|
+
- Allow newer puppet-blacksmith versions [\#197](https://github.com/voxpupuli/modulesync/pull/197) ([bastelfreak](https://github.com/bastelfreak))
|
38
|
+
|
39
|
+
## [2.0.0](https://github.com/voxpupuli/modulesync/tree/2.0.0) (2020-08-18)
|
40
|
+
|
41
|
+
[Full Changelog](https://github.com/voxpupuli/modulesync/compare/1.3.0...2.0.0)
|
42
|
+
|
43
|
+
**Breaking changes:**
|
44
|
+
|
45
|
+
- Drop support for Ruby 2.4 and older [\#191](https://github.com/voxpupuli/modulesync/pull/191) ([bastelfreak](https://github.com/bastelfreak))
|
46
|
+
|
47
|
+
**Implemented enhancements:**
|
48
|
+
|
49
|
+
- Symbolize keys in managed\_modules except for module names [\#185](https://github.com/voxpupuli/modulesync/pull/185) ([raphink](https://github.com/raphink))
|
50
|
+
|
51
|
+
**Fixed bugs:**
|
52
|
+
|
53
|
+
- GitLab MR: undefined method `\[\]' for nil:NilClass \(NoMethodError\) [\#187](https://github.com/voxpupuli/modulesync/issues/187)
|
54
|
+
- msync fails with nilClass error [\#172](https://github.com/voxpupuli/modulesync/issues/172)
|
55
|
+
- Fix NoMethodError for --pr option \(caused by `module_options = nil`\) / introduce --noop [\#188](https://github.com/voxpupuli/modulesync/pull/188) ([bittner](https://github.com/bittner))
|
56
|
+
- Allow empty module options in self.pr\(\) [\#186](https://github.com/voxpupuli/modulesync/pull/186) ([raphink](https://github.com/raphink))
|
57
|
+
|
58
|
+
## [1.3.0](https://github.com/voxpupuli/modulesync/tree/1.3.0) (2020-07-03)
|
59
|
+
|
60
|
+
* Expose --managed_modules_conf [#184](https://github.com/voxpupuli/modulesync/pull/184)
|
61
|
+
* Allow absolute path for config files [#183](https://github.com/voxpupuli/modulesync/pull/183)
|
62
|
+
* Add pr_target_branch option [#182](https://github.com/voxpupuli/modulesync/pull/182)
|
63
|
+
* Allow to specify namespace in module_options [#181](https://github.com/voxpupuli/modulesync/pull/181)
|
64
|
+
* Allow to override PR parameters per module [#178](https://github.com/voxpupuli/modulesync/pull/178)
|
65
|
+
* Include the gitlab library (if we interact with gitlab), not github [#179](https://github.com/voxpupuli/modulesync/pull/179)
|
66
|
+
|
67
|
+
## 2020-07-03 - 1.2.0
|
68
|
+
|
69
|
+
* Add support for GitLab merge requests (MRs) [#175](https://github.com/voxpupuli/modulesync/pull/175)
|
70
|
+
|
3
71
|
## 2020-05-01 - 1.1.0
|
4
72
|
|
5
73
|
This release provides metadata in the ERB template scope which makes it easy to read files from inside the module. A possible application is reading metadata.json and generating CI configs based on that.
|
@@ -214,3 +282,6 @@ Also fixes the README to document the very important -m flag.
|
|
214
282
|
|
215
283
|
This release adds support for other SSH-based git servers, which means
|
216
284
|
gitlab is now supported.
|
285
|
+
|
286
|
+
|
287
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/Gemfile
CHANGED
data/HISTORY.md
ADDED
@@ -0,0 +1,227 @@
|
|
1
|
+
## [1.3.0](https://github.com/voxpupuli/modulesync/tree/1.3.0) (2020-07-03)
|
2
|
+
|
3
|
+
* Expose --managed_modules_conf [#184](https://github.com/voxpupuli/modulesync/pull/184)
|
4
|
+
* Allow absolute path for config files [#183](https://github.com/voxpupuli/modulesync/pull/183)
|
5
|
+
* Add pr_target_branch option [#182](https://github.com/voxpupuli/modulesync/pull/182)
|
6
|
+
* Allow to specify namespace in module_options [#181](https://github.com/voxpupuli/modulesync/pull/181)
|
7
|
+
* Allow to override PR parameters per module [#178](https://github.com/voxpupuli/modulesync/pull/178)
|
8
|
+
* Include the gitlab library (if we interact with gitlab), not github [#179](https://github.com/voxpupuli/modulesync/pull/179)
|
9
|
+
|
10
|
+
## 2020-07-03 - 1.2.0
|
11
|
+
|
12
|
+
* Add support for GitLab merge requests (MRs) [#175](https://github.com/voxpupuli/modulesync/pull/175)
|
13
|
+
|
14
|
+
## 2020-05-01 - 1.1.0
|
15
|
+
|
16
|
+
This release provides metadata in the ERB template scope which makes it easy to read files from inside the module. A possible application is reading metadata.json and generating CI configs based on that.
|
17
|
+
|
18
|
+
* Add metadata to ERB template scope - [#168](https://github.com/voxpupuli/modulesync/pull/168)
|
19
|
+
* Skip issuing a PR if one already exists for -b option - [#171](https://github.com/voxpupuli/modulesync/pull/171)
|
20
|
+
* Correct the type on the pr-labels option to prevent a deprecation warning - [#173](https://github.com/voxpupuli/modulesync/pull/173)
|
21
|
+
|
22
|
+
## 2019-09-19 - 1.0.0
|
23
|
+
|
24
|
+
This is the first stable release! 🎉
|
25
|
+
|
26
|
+
* Use namespace in directory structure when cloning repositories - [#152](https://github.com/voxpupuli/modulesync/pull/152)
|
27
|
+
* Fix minor typo in help output - [#165](https://github.com/voxpupuli/modulesync/pull/165)
|
28
|
+
* Small improvements and fixes - [#166](https://github.com/voxpupuli/modulesync/pull/166)
|
29
|
+
* Fix overwriting of :global values - [#169](https://github.com/voxpupuli/modulesync/pull/169)
|
30
|
+
|
31
|
+
## 2018-12-27 - 0.10.0
|
32
|
+
|
33
|
+
This is another awesome release!
|
34
|
+
|
35
|
+
* Add support to submit PRs to GitHub when changes are pushed - [#147](https://github.com/voxpupuli/modulesync/pull/147)
|
36
|
+
* Fix "flat files" still mentioned in README - [#151](https://github.com/voxpupuli/modulesync/pull/151)
|
37
|
+
|
38
|
+
## 2018-02-15 - 0.9.0
|
39
|
+
|
40
|
+
## Summary
|
41
|
+
|
42
|
+
This is an awesome release - Now honors the repo default branch[#142](https://github.com/voxpupuli/modulesync/pull/142)
|
43
|
+
|
44
|
+
### Bugfixes
|
45
|
+
|
46
|
+
* Monkey patch ls_files until ruby-git/ruby-git#320 is resolved
|
47
|
+
* Reraise exception rather than exit so we can rescue a derived StandardError when using skip_broken option
|
48
|
+
|
49
|
+
### Enhancements
|
50
|
+
|
51
|
+
* Add new option to produce a failure exit code on warnings
|
52
|
+
* Remove hard coding of managed_modules.yml which means that options passed to ModuleSync.update can override the filename
|
53
|
+
|
54
|
+
## 2017-11-03 - 0.8.2
|
55
|
+
|
56
|
+
### Summary
|
57
|
+
|
58
|
+
This release fixes:
|
59
|
+
* Bug that caused .gitignore file handle to be left open - [#131](https://github.com/voxpupuli/modulesync/pull/131).
|
60
|
+
* Fixed switch_branch to use current_branch instead of master - [#130](https://github.com/voxpupuli/modulesync/pull/130).
|
61
|
+
* Fixed bug where failed runs wouldn't return correct exit code - [#125](https://github.com/voxpupuli/modulesync/pull/125).
|
62
|
+
* Fix typo in README link to Voxpupuli modulesync_config [#123](https://github.com/voxpupuli/modulesync/pull/123).
|
63
|
+
|
64
|
+
## 2017-05-08 - 0.8.1
|
65
|
+
|
66
|
+
### Summary
|
67
|
+
|
68
|
+
This release fixes a nasty bug with CLI vs configuration file option handling: Before [#117](https://github.com/voxpupuli/modulesync/pull/117) it was not possible to override options set in `modulesync.yml` on the command line, which could cause confusion in many cases. Now the configuration file is only used to populate the default values of the options specified in the README, and setting them on the command line will properly use those new values.
|
69
|
+
|
70
|
+
## 2017-05-05 - 0.8.0
|
71
|
+
|
72
|
+
### Summary
|
73
|
+
|
74
|
+
This release now prefers `.erb` suffixes on template files. To convert your moduleroot directory, run this command in your configs repo:
|
75
|
+
|
76
|
+
find moduleroot/ -type f -exec git mv {} {}.erb \;
|
77
|
+
|
78
|
+
Note that any `.erb`-suffixed configuration keys in `config_defaults.yml`, and `.sync.yml` need to be removed by hand. (This was unreleased functionality, will not affect most users.)
|
79
|
+
|
80
|
+
#### Refactoring
|
81
|
+
|
82
|
+
- Prefer `.erb` suffixes on template files, issue deprecation warning for templates without the extension
|
83
|
+
- Require Ruby 2.0 or higher
|
84
|
+
|
85
|
+
#### Bugfixes
|
86
|
+
|
87
|
+
- Fix dependency on `git` gem for diff functionality
|
88
|
+
- Fix error from `git` gem when diff contained line ending changes
|
89
|
+
|
90
|
+
## 2017-02-13 - 0.7.2
|
91
|
+
|
92
|
+
Fixes an issue releasing 0.7.1, no functional changes.
|
93
|
+
|
94
|
+
## 2017-02-13 - 0.7.1
|
95
|
+
|
96
|
+
Fixes an issue releasing 0.7.0, no functional changes.
|
97
|
+
|
98
|
+
## 2017-02-13 - 0.7.0
|
99
|
+
|
100
|
+
### Summary
|
101
|
+
|
102
|
+
This is the first release from Vox Pupuli, which has taken over maintenance of
|
103
|
+
modulesync.
|
104
|
+
|
105
|
+
#### Features
|
106
|
+
- New `msync update` arguments:
|
107
|
+
- `--git-base` to override `git_base`, e.g. for read-only git clones
|
108
|
+
- `-s` to skip the current module and continue on error
|
109
|
+
- `-x` for a negative filter (blacklist) of modules not to update
|
110
|
+
- Add `-a` argument to `msync hook` to pass additional arguments
|
111
|
+
- Add `:git_base` and `:namespace` data to `@configs` hash
|
112
|
+
- Allow `managed_modules.yml` to list modules with a different namespace
|
113
|
+
- Entire directories can be listed with `unmanaged: true`
|
114
|
+
|
115
|
+
#### Refactoring
|
116
|
+
- Replace CLI optionparser with thor
|
117
|
+
|
118
|
+
#### Bugfixes
|
119
|
+
- Fix git 1.8.0 compatibility, detecting when no files are changed
|
120
|
+
- Fix `delete: true` feature, now deletes files correctly
|
121
|
+
- Fix handling of `:global` config entries, not interpreted as a path
|
122
|
+
- Fix push without force to remote branch when no files have changed (#102)
|
123
|
+
- Output template name when ERB rendering fails
|
124
|
+
- Remove extraneous whitespace in `--noop` output
|
125
|
+
|
126
|
+
## 2015-08-13 - 0.6.1
|
127
|
+
|
128
|
+
### Summary
|
129
|
+
|
130
|
+
This is a bugfix release to fix an issue caused by the --project-root flag.
|
131
|
+
|
132
|
+
#### Bugfixes
|
133
|
+
|
134
|
+
- Fix bug in git pull function (#55)
|
135
|
+
|
136
|
+
##2015-08-11 - 0.6.0
|
137
|
+
|
138
|
+
### Summary
|
139
|
+
|
140
|
+
This release adds two new flags to help modulesync better integrate with CI tools.
|
141
|
+
|
142
|
+
#### Features
|
143
|
+
|
144
|
+
- Add --project-root flag
|
145
|
+
- Create --offline flag to disable git functionality
|
146
|
+
|
147
|
+
#### Bugfixes
|
148
|
+
|
149
|
+
- Fix :remote option for repo
|
150
|
+
|
151
|
+
#### Maintenance
|
152
|
+
|
153
|
+
- Added tests
|
154
|
+
|
155
|
+
## 2015-06-30 - 0.5.0
|
156
|
+
|
157
|
+
### Summary
|
158
|
+
|
159
|
+
This release adds the ability to sync a non-bare local git repo.
|
160
|
+
|
161
|
+
#### Features
|
162
|
+
|
163
|
+
- Allow one to sync non-bare local git repository
|
164
|
+
|
165
|
+
## 2015-06-24 - 0.4.0
|
166
|
+
|
167
|
+
### Summary
|
168
|
+
|
169
|
+
This release adds a --remote-branch flag and adds a global key for template
|
170
|
+
config.
|
171
|
+
|
172
|
+
#### Features
|
173
|
+
|
174
|
+
- Expose --remote-branch
|
175
|
+
- Add a global config key
|
176
|
+
|
177
|
+
#### Bugfixes
|
178
|
+
|
179
|
+
- Fix markdown syntax in README
|
180
|
+
|
181
|
+
## 2015-03-12 - 0.3.0
|
182
|
+
|
183
|
+
### Summary
|
184
|
+
|
185
|
+
This release contains a breaking change to some parameters exposed in
|
186
|
+
modulesync.yml. In particular, it abandons the user of git_user and
|
187
|
+
git_provider in favor of the parameter git_base to specify the base part of a
|
188
|
+
git URL to pull from. It also adds support for gerrit by adding a remote_branch
|
189
|
+
parameter for modulesync.yml that can differ from the local branch, plus a
|
190
|
+
number of new flags for updating modules.
|
191
|
+
|
192
|
+
#### Backwards-incompatible changes
|
193
|
+
|
194
|
+
- Remove git_user and git_provider_address as parameters in favor of using
|
195
|
+
git_base as a whole
|
196
|
+
|
197
|
+
#### Features
|
198
|
+
|
199
|
+
- Expose the puppet module name in the ERB templates
|
200
|
+
- Add support for gerrit by:
|
201
|
+
- Adding a --amend flag
|
202
|
+
- Adding a remote_branch parameter for modulesync.yml config file that can
|
203
|
+
differ from the local branch
|
204
|
+
- Adding a script to handle the pre-commit hook for adding a commit id
|
205
|
+
- Using git_base to specify an arbitrary git URL instead of an SCP-style one
|
206
|
+
- Add a --force flag (usually needed with the --amend flag if not using gerrit)
|
207
|
+
- Add --bump, --tag, --tag-pattern, and --changelog flags
|
208
|
+
|
209
|
+
#### Bugfixes
|
210
|
+
|
211
|
+
- Stop requiring .gitignore to exist
|
212
|
+
- Fix non-master branch functionality
|
213
|
+
- Add workarounds for older git versions
|
214
|
+
|
215
|
+
## 2014-11-16 - 0.2.0
|
216
|
+
|
217
|
+
### Summary
|
218
|
+
|
219
|
+
This release adds the --filter flag to filter what modules to sync.
|
220
|
+
Also fixes the README to document the very important -m flag.
|
221
|
+
|
222
|
+
## 2014-9-29 - 0.1.0
|
223
|
+
|
224
|
+
### Summary
|
225
|
+
|
226
|
+
This release adds support for other SSH-based git servers, which means
|
227
|
+
gitlab is now supported.
|
data/README.md
CHANGED
@@ -169,34 +169,57 @@ msync hook activate
|
|
169
169
|
```
|
170
170
|
|
171
171
|
If you have activated the hook but want to make changes to the configuration
|
172
|
-
directory (such as changes to managed_modules.yml or modulesync.yml) without
|
172
|
+
directory (such as changes to `managed_modules.yml` or `modulesync.yml`) without
|
173
173
|
touching the modules, you can deactivate the hook.
|
174
174
|
|
175
175
|
```
|
176
176
|
msync hook deactivate
|
177
177
|
```
|
178
178
|
|
179
|
-
#### Submitting PRs to GitHub
|
179
|
+
#### Submitting PRs/MRs to GitHub or GitLab
|
180
180
|
|
181
|
-
You can have modulesync submit Pull Requests on GitHub
|
182
|
-
`--pr` CLI option.
|
181
|
+
You can have modulesync submit Pull Requests on GitHub or Merge Requests on
|
182
|
+
GitLab automatically with the `--pr` CLI option.
|
183
183
|
|
184
184
|
```
|
185
185
|
msync update --pr
|
186
186
|
```
|
187
187
|
|
188
|
-
|
189
|
-
|
188
|
+
In order for GitHub PRs or GitLab MRs to work, you must either provide
|
189
|
+
the `GITHUB_TOKEN` or `GITLAB_TOKEN` environment variables,
|
190
|
+
or set them per repository in `managed_modules.yml`, using the `github` or
|
191
|
+
`gitlab` keys respectively.
|
190
192
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
`pr_labels` attribute. **NOTE:** `pr_labels` should be a list. When using
|
195
|
-
the `--pr-labels` CLI option, you should use a comma separated list.
|
193
|
+
For GitHub Enterprise and self-hosted GitLab instances you also need to set the
|
194
|
+
`GITHUB_BASE_URL` or `GITLAB_BASE_URL` environment variables, or specify the
|
195
|
+
`base_url` parameter in `modulesync.yml`:
|
196
196
|
|
197
|
-
|
198
|
-
|
199
|
-
|
197
|
+
```yaml
|
198
|
+
---
|
199
|
+
repo1:
|
200
|
+
github:
|
201
|
+
token: 'EXAMPLE_TOKEN'
|
202
|
+
base_url: 'https://api.github.com/'
|
203
|
+
|
204
|
+
repo2:
|
205
|
+
gitlab:
|
206
|
+
token: 'EXAMPLE_TOKEN'
|
207
|
+
base_url: 'https://git.example.com/api/v4'
|
208
|
+
```
|
209
|
+
|
210
|
+
Then:
|
211
|
+
|
212
|
+
* Set the PR/MR title with `--pr-title` or in `modulesync.yml` with the
|
213
|
+
`pr_title` attribute.
|
214
|
+
* Assign labels to the PR/MR with `--pr-labels` or in `modulesync.yml` with
|
215
|
+
the `pr_labels` attribute. **NOTE:** `pr_labels` should be a list. When
|
216
|
+
using the `--pr-labels` CLI option, you should use a comma separated list.
|
217
|
+
* Set the target branch with `--pr-target-branch` or in `modulesync.yml` with
|
218
|
+
the `pr_target_branch` attribute.
|
219
|
+
|
220
|
+
More details for GitHub:
|
221
|
+
|
222
|
+
* Octokit [`api_endpoint`](https://github.com/octokit/octokit.rb#interacting-with-the-githubcom-apis-in-github-enterprise)
|
200
223
|
|
201
224
|
### Using Forks and Non-master branches
|
202
225
|
|
@@ -253,13 +276,15 @@ msync update -m "Commit message"
|
|
253
276
|
Available parameters for modulesync.yml
|
254
277
|
|
255
278
|
* `git_base` : The default URL to git clone from (Default: 'git@github.com:')
|
256
|
-
* `namespace` : Namespace of the projects to manage (Default: 'puppetlabs')
|
279
|
+
* `namespace` : Namespace of the projects to manage (Default: 'puppetlabs').
|
280
|
+
This value can be overridden in the module name (e.g. 'namespace/mod') or by
|
281
|
+
using the `namespace` key for the module in `managed_modules.yml`.
|
257
282
|
* `branch` : Branch to push to (Default: 'master')
|
258
283
|
* `remote_branch` : Remote branch to push to (Default: Same value as branch)
|
259
284
|
* `message` : Commit message to apply to updated modules.
|
260
285
|
* `pre_commit_script` : A script to be run before commiting (e.g. 'contrib/myfooscript.sh')
|
261
|
-
* `pr_title` : The title to use when submitting PRs to GitHub.
|
262
|
-
* `pr_labels` : A list of labels to assign PRs created on GitHub.
|
286
|
+
* `pr_title` : The title to use when submitting PRs/MRs to GitHub or GitLab.
|
287
|
+
* `pr_labels` : A list of labels to assign PRs/MRs created on GitHub or GitLab.
|
263
288
|
|
264
289
|
##### Example
|
265
290
|
|