cimas 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +39 -43
- data/lib/cimas/cli/command.rb +21 -2
- data/lib/cimas/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96ff28c48d78e8043cabfbd44923abe5601563073ced3a64ed421beef5c97be7
|
4
|
+
data.tar.gz: 570e80bff89e510e3057dfc570b7a593a98ad8cf2a6dd3401e716296d2d04ed4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 195e11ba4eb52f1e38b332131590c3501652d4597f33e957d2632fa3d1194f1421c452da33a02fb34c64611f9793b32db206175d4f9fd100cd690df0033ee77b
|
7
|
+
data.tar.gz: 9cfb9aeaaed12894e646177357227e87491a2069e00eac8b1828119a352d83dc527c306d0000c18a484733e540996048b540b7c4368ef2fa9b301361dd08aa22
|
data/README.adoc
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
= Cimas ("`Continuous integration master`")
|
2
2
|
|
3
|
+
image:https://img.shields.io/gem/v/cimas.svg["Gem Version", link="https://rubygems.org/gems/cimas"]
|
4
|
+
image:https://codeclimate.com/github/metanorma/cimas/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/cimas"]
|
5
|
+
image:https://img.shields.io/github/issues-pr-raw/metanorma/cimas.svg["Pull Requests", link="https://github.com/metanorma/cimas/pulls"]
|
6
|
+
image:https://img.shields.io/github/commits-since/metanorma/cimas/latest.svg["Commits since latest",link="https://github.com/metanorma/cimas/releases"]
|
7
|
+
|
3
8
|
== Purpose
|
4
9
|
|
5
10
|
Cimas handles synchronizing CI configuration across multiple repositories.
|
@@ -43,6 +48,7 @@ gem install cimas
|
|
43
48
|
Or, by specifying it in your `Gemfile` if you're using Bundler.
|
44
49
|
|
45
50
|
|
51
|
+
|
46
52
|
== Concepts
|
47
53
|
|
48
54
|
CI configuration file:: file to configure CI behavior of a repository
|
@@ -52,9 +58,36 @@ Cimas working area:: local directory where Cimas works within
|
|
52
58
|
Cimas managed repository:: repository with CI configuration managed by Cimas
|
53
59
|
|
54
60
|
|
61
|
+
== Demonstration
|
62
|
+
|
63
|
+
The https://github.com/metanorma/metanorma-build-scripts[`metanorma-build-scripts`]
|
64
|
+
repository contains Cimas configuration under `cimas-config/`
|
65
|
+
for the https://github.com/metanorma[Metanorma] repositories.
|
66
|
+
|
67
|
+
* `cimas-config/`: the CI master configuration directory
|
68
|
+
* `cimas-config/cimas.yml`: the Cimas configuration file
|
69
|
+
|
70
|
+
Have a look to see how it's being used!
|
71
|
+
|
72
|
+
|
73
|
+
== Prerequisites
|
74
|
+
|
75
|
+
=== Setting up the CI configuration master directory
|
76
|
+
|
77
|
+
You need to first create a "`CI configuration master directory`" to
|
78
|
+
contain master files for CI configuration.
|
79
|
+
It is advisable to store the directory in Git for better version management.
|
80
|
+
|
81
|
+
For example, with https://github.com/metanorma[Metanorma] repositories,
|
82
|
+
the CI master configuration directory is placed in the
|
83
|
+
https://github.com/metanorma/metanorma-build-scripts[`metanorma-build-scripts`]
|
84
|
+
repository under `cimas-config/`.
|
85
|
+
|
86
|
+
|
55
87
|
|
56
88
|
== Usage
|
57
89
|
|
90
|
+
|
58
91
|
=== Command line
|
59
92
|
|
60
93
|
Cimas works through the `cimas` executable. `cimas` provides the following sub-commands.
|
@@ -202,10 +235,11 @@ by adding commits and branches.
|
|
202
235
|
|
203
236
|
==== `cimas open-prs`
|
204
237
|
|
205
|
-
The `
|
238
|
+
The `open-prs` sub-command:
|
206
239
|
|
207
|
-
*
|
208
|
-
*
|
240
|
+
* opens Pull Requests for all the specified repositories of the given branch;
|
241
|
+
* creates Pull Request Review Requests for the created Pull Requests (if `reviewers` are set in `cimas.yaml:settings` or via the `-w` option);
|
242
|
+
* assigns the created Pull Requests to assignees (if `assignees` are set in `cimas.yaml:settings` or via the `-a` option).
|
209
243
|
|
210
244
|
Since this command depends on GitHub privileged functionality,
|
211
245
|
you must supply your GitHub Personal Access Token (PAT)
|
@@ -222,6 +256,8 @@ cimas open-prs -f {cimas-config-file} -r {cimas-working-area} \
|
|
222
256
|
# cimas open-prs -f cimas.yml -r ~/src/cimas-wd \
|
223
257
|
# -b my-new-ci-branch \
|
224
258
|
# -m 'My pull-request message' \
|
259
|
+
# [-w {reviewer1,reviewer2...}] \
|
260
|
+
# [-a {assignee1,assignee2...}] \
|
225
261
|
# [-g {group1,group2,...}]
|
226
262
|
----
|
227
263
|
|
@@ -411,46 +447,6 @@ groups:
|
|
411
447
|
----
|
412
448
|
|
413
449
|
|
414
|
-
=== Setting up the CI configuration master directory
|
415
|
-
|
416
|
-
You need to first create the "`CIM configuration directory`".
|
417
|
-
|
418
|
-
Typically you'd create one in Git for better version management.
|
419
|
-
|
420
|
-
For example, with https://github.com/metanorma[Metanorma] repositories,
|
421
|
-
the CIM configuration directory is placed in the https://github.com/metanorma/metanorma-build-scripts[`metanorma-build-scripts`]
|
422
|
-
repository.
|
423
|
-
|
424
|
-
|
425
|
-
=== Setting up the local CIM working area
|
426
|
-
|
427
|
-
CIM requires a local working area to work with managed repositories,
|
428
|
-
using Git's pull and push functionalities.
|
429
|
-
|
430
|
-
This only _needs to be done once_ (locally), then you can reuse
|
431
|
-
this working area for future CI configuration updates.
|
432
|
-
|
433
|
-
// `$mn-root`
|
434
|
-
|
435
|
-
You need to create the CIM working area
|
436
|
-
|
437
|
-
Checkout all repositories
|
438
|
-
|
439
|
-
[source,sh]
|
440
|
-
----
|
441
|
-
# suppose the CIM working area is called $CIM_CONFIG_WD
|
442
|
-
mkdir $CIM_CONFIG_WD
|
443
|
-
cd $CIM_CONFIG_WD
|
444
|
-
repo init -u $CIM_CONFIG_REPO
|
445
|
-
repo sync
|
446
|
-
git multi checkout master
|
447
|
-
echo 'metanorma-build-scripts' > .multigit_ignore
|
448
|
-
git clone https://github.com/metanorma/cimas.git
|
449
|
-
cd cimas
|
450
|
-
----
|
451
|
-
|
452
|
-
|
453
|
-
|
454
450
|
|
455
451
|
== Development
|
456
452
|
|
data/lib/cimas/cli/command.rb
CHANGED
@@ -108,7 +108,10 @@ module Cimas
|
|
108
108
|
filtered_repo_names.each do |repo_name|
|
109
109
|
|
110
110
|
repo = repo_by_name(repo_name)
|
111
|
-
|
111
|
+
if repo.nil?
|
112
|
+
puts "[WARNING] #{repo_name} not configured, skipping."
|
113
|
+
next
|
114
|
+
end
|
112
115
|
|
113
116
|
branch = repo['branch']
|
114
117
|
files = repo['files']
|
@@ -155,7 +158,10 @@ module Cimas
|
|
155
158
|
filtered_repo_names.each do |repo_name|
|
156
159
|
|
157
160
|
repo = repo_by_name(repo_name)
|
158
|
-
|
161
|
+
if repo.nil?
|
162
|
+
puts "[WARNING] #{repo_name} not configured, skipping."
|
163
|
+
next
|
164
|
+
end
|
159
165
|
|
160
166
|
branch = repo['branch']
|
161
167
|
files = repo['files']
|
@@ -250,6 +256,11 @@ module Cimas
|
|
250
256
|
filtered_repo_names.each do |repo_name|
|
251
257
|
|
252
258
|
repo = repo_by_name(repo_name)
|
259
|
+
if repo.nil?
|
260
|
+
puts "[WARNING] #{repo_name} not configured, skipping."
|
261
|
+
next
|
262
|
+
end
|
263
|
+
|
253
264
|
branch = repo['branch']
|
254
265
|
files = repo['files']
|
255
266
|
|
@@ -311,6 +322,10 @@ module Cimas
|
|
311
322
|
|
312
323
|
filtered_repo_names.each do |repo_name|
|
313
324
|
repo = repo_by_name(repo_name)
|
325
|
+
if repo.nil?
|
326
|
+
puts "[WARNING] #{repo_name} not configured, skipping."
|
327
|
+
next
|
328
|
+
end
|
314
329
|
|
315
330
|
repo_dir = File.join(repos_path, repo_name)
|
316
331
|
unless File.exist?(repo_dir)
|
@@ -359,6 +374,10 @@ module Cimas
|
|
359
374
|
|
360
375
|
filtered_repo_names.each do |repo_name|
|
361
376
|
repo = repo_by_name(repo_name)
|
377
|
+
if repo.nil?
|
378
|
+
puts "[WARNING] #{repo_name} not configured, skipping."
|
379
|
+
next
|
380
|
+
end
|
362
381
|
|
363
382
|
repo_dir = File.join(repos_path, repo_name)
|
364
383
|
unless File.exist?(repo_dir)
|
data/lib/cimas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cimas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: travis
|