power_stencil 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +9 -0
- data/README.md +25 -15
- data/doc/builds.md +2 -1
- data/doc/entities.md +4 -4
- data/doc/faq.md +2 -1
- data/doc/plugins.md +3 -3
- data/doc/templates.md +2 -0
- data/lib/power_stencil/plugins/gem.rb +1 -1
- data/lib/power_stencil/version.rb +1 -1
- data/power_stencil.gemspec +3 -3
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5c65ac5df9e06a48f189b8b5abca257f80e8109
|
4
|
+
data.tar.gz: 24d671da7a9b7d63b06047b4319b08577d51c18b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 798153c2ea0a7dafd7c69fa011bbe9214e5cf34ec609a3449230ec094e9ec65839004c8f6bbd068182ff757135993601ba4417fc95f501147125d6365b3b1d2e
|
7
|
+
data.tar.gz: aabc03f3d18ab11f50f6c2790a94e817b626bf10d8762f35df2e42fa3b7db1dce7aaba8bcdbbe9b1ce4d47b3b631b388f610faa879bba31eb69dd5b787366fed
|
data/.gitlab-ci.yml
ADDED
data/README.md
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
PowerStencil
|
2
2
|
============
|
3
3
|
|
4
|
+
[![ ](https://gitlab.com/tools4devops/power_stencil/badges/master/pipeline.svg)](https://gitlab.com/tools4devops/power_stencil/commits/master)
|
5
|
+
|
4
6
|
`Power Stencil` is the Swiss-army knife templating workflow for developers and ops.
|
5
7
|
|
8
|
+
See [official website][PowerStencil site].
|
9
|
+
|
10
|
+
|
6
11
|
<!-- TOC -->
|
7
12
|
|
8
13
|
- [Overview](#overview)
|
9
|
-
- [Pfff, yet another templating engine
|
14
|
+
- [Pfff, yet another templating engine...?](#pfff-yet-another-templating-engine)
|
10
15
|
- [Installation](#installation)
|
11
16
|
- [Usage](#usage)
|
12
17
|
- [Help](#help)
|
@@ -28,7 +33,7 @@ PowerStencil
|
|
28
33
|
|
29
34
|
`PowerStencil` proposes a radical approach on how to manage your shared configuration.
|
30
35
|
|
31
|
-
**Configuration** is one of the most complex things to maintain, and anyone who participated in a large scale piece of software or documentation knows how complex it is to maintain, **keep consistent and avoid duplication** on the long run across the various projects that may share this configuration.
|
36
|
+
**Configuration** is one of the most complex things to maintain, and anyone who participated in a large scale piece of software, be it for code, tools configuration or even documentation, knows how complex it is to maintain, **keep consistent and avoid duplication** on the long run, across the various projects that may share this configuration.
|
32
37
|
|
33
38
|
From a very high level point of view, the workfow `PowerStencil` proposes looks like:
|
34
39
|
|
@@ -36,7 +41,7 @@ From a very high level point of view, the workfow `PowerStencil` proposes looks
|
|
36
41
|
|
37
42
|
`PowerStencil` provides **development and operations friendly workflows to fully manage the maintenance of a complex shared config** in order to generate anything you may want like _documentation_, _static sites_, _code_, _configuration_ for multiple tools..., while **avoiding duplication, and manage it like code** !
|
38
43
|
|
39
|
-
It is a common pattern to introduce a database to manage shared configuration for CI/CD processes, and it is a very bad idea (see [F.A.Q.]) because it implies extra tooling, and specific developments that de-facto become single point of failure at the heart of your development process. Why would you do that when something as versatile and ubiquitous as Git exists that will integrate smoothly within your existing development and operations workflows, builds, CI/CD processes, while benefiting from all the goodness provided by Git, like branches, decentralization, versioning, tags, code reviews, traceability, simplified fallbacks etc... ?
|
44
|
+
It is a common pattern to introduce a database to manage shared configuration for CI/CD processes, and it is a very bad idea (see [F.A.Q.][DB in F.A.Q.]) because it implies extra tooling, and specific developments that de-facto become single point of failure at the heart of your development process. Why would you do that when something as versatile and ubiquitous as Git exists that will integrate smoothly within your existing development and operations workflows, builds, CI/CD processes, while benefiting from all the goodness provided by Git, like branches, decentralization, versioning, tags, code reviews, traceability, simplified fallbacks etc... ?
|
40
45
|
|
41
46
|
A `PowerStencil` project is composed of a data repository and a pretty standard templating flow to generate whatever is needed by your project or organization and **with `PowerStencil` everything is maintained in a git repository**: data, templates, specific code **without sacrificing on data integrity and relational features**. No more config loss, no more change applied without a full lineage.
|
42
47
|
|
@@ -48,22 +53,25 @@ The `PowerStencil` gem provides the `power_stencil` executable which is a plugga
|
|
48
53
|
- Visualize your **data relations with graphviz**. Customize generated graphs easily.
|
49
54
|
- Easily **manage templates** to generate whatever your project/organization requires.
|
50
55
|
- Define builds that you can easily **embed in your CI/CD process** or use them standalone.
|
51
|
-
-
|
56
|
+
- Propose mechanism to temporarily override some data to test changes impact without polluting the official repository data.
|
57
|
+
- Ensure **re-usability** with a versatile extension mechanism, including plugins.
|
52
58
|
|
53
|
-
# Pfff, yet another templating engine
|
59
|
+
# Pfff, yet another templating engine...?
|
54
60
|
|
55
61
|
**Actually `PowerStencil` is _not_ a templating engine**. It uses already existing and proven templating engines.
|
56
62
|
|
57
|
-
Currently it uses [ERB], which is a pretty standard and very well known engine in the [Ruby] world and especially for people who already used the [Rails] framework. Virtually any templating engine existing in the Ruby ecosystem could be integrated in the `PowerStencil` framework next to [ERB]
|
63
|
+
Currently it uses [ERB], which is a pretty standard and very well known engine in the [Ruby] world and especially for people who already used the [Rails] framework. Virtually any templating engine existing in the Ruby ecosystem could be integrated in the `PowerStencil` framework next to [ERB] (as `PowerStencil` already comes with a mechanism to select a templating engine regarding some criteria like file extension, path etc...).
|
64
|
+
|
65
|
+
This will probably be the case in a future release, at least to integrate the [Haml] templating engine in order to ease the generation of XML-like files, still you obviously already can do it with [ERB].
|
58
66
|
|
59
|
-
|
67
|
+
So `PowerStencil` is definitely not a templating it is actually much more than that.
|
60
68
|
|
61
69
|
|
62
70
|
# Installation
|
63
71
|
|
64
72
|
You need a working install of the [Ruby] language (>= 2.3).
|
65
73
|
|
66
|
-
|
74
|
+
Then you can install the `PowerStencil` gem by issuing the usual:
|
67
75
|
|
68
76
|
$ gem install power_stencil
|
69
77
|
|
@@ -75,7 +83,7 @@ If you want to create graphviz graphs, you probably may want to install it for y
|
|
75
83
|
|
76
84
|
## Help
|
77
85
|
|
78
|
-
The `power_stencil` CLI provides a contextual help. You can
|
86
|
+
The `power_stencil` CLI provides a contextual help. You can begin with:
|
79
87
|
|
80
88
|
$ power_stencil --help
|
81
89
|
|
@@ -120,13 +128,13 @@ The program uses the standard paradigm of sub-commands (à-la-git), and each can
|
|
120
128
|
|
121
129
|
## Creating a `PowerStencil` project
|
122
130
|
|
123
|
-
To create a new project, use the `init` sub-command. It works as you would expect. If you run it in an existing directory it will create the project here but you can specify the directory where you want the project to be created (the path will be created provided you have
|
131
|
+
To create a new project, use the `init` sub-command. It works as you would expect. If you run it in an existing directory it will create the project here but you can specify the directory where you want the project to be created (the path will be created provided you have enough rights on the filesystem):
|
124
132
|
|
125
133
|
$ power_stencil init /where/you/want/your/project
|
126
134
|
|
127
135
|
Once the project created, if you are anywhere within the project tree, you don't need to specify the project path anymore (if needed, any `power_stencil` sub-command supports a `--project-path` option). If you're used to the Git command line, it works the same way, and you should not feel in uncharted territory...
|
128
136
|
|
129
|
-
|
137
|
+
**:information_source: The rest of this documentation will assume you are at the root of this created project.**
|
130
138
|
|
131
139
|
**:information_source: Of course, once you've been creating a new project, you should version it with Git:**
|
132
140
|
|
@@ -162,12 +170,12 @@ Not all the files in this directory should be versioned, and this the reason why
|
|
162
170
|
|
163
171
|
The project has two distinct config files.
|
164
172
|
|
165
|
-
- Keep the official project config in the `.ps_project/versioned-config.yaml` which, as its name suggest, will be versioned.
|
166
|
-
- But any developer who wants to temporarily override some configuration should do it in the `.ps_project/personal-config.yaml`, which is not be versioned. The content defined in the latter
|
173
|
+
- Keep the official project config in the `.ps_project/versioned-config.yaml` which, as its name suggest, will be git versioned.
|
174
|
+
- But any developer who wants to temporarily override some configuration should do it in the `.ps_project/personal-config.yaml`, which is not to be versioned. The content defined in the latter will override the content of the versioned one.
|
167
175
|
|
168
176
|
**This is a clean way for anyone who wants to test something to safely do it locally without the risk to pollute the central repo.**
|
169
177
|
|
170
|
-
There is the same mechanism between `.ps_project/entities` (where the project data is stored and which is versioned) and `.ps_project/user_entities` (where local data is stored and not versioned), but as opposed to the two aforementioned config files, you should not edit anything directly there but instead use the CLI or the shell. More information on how to manage entities [here][entities].
|
178
|
+
There is the same mechanism between `.ps_project/entities` (where the project data is stored and which is versioned) and `.ps_project/user_entities` (where local data is stored and not versioned), but as opposed to the two aforementioned config files, you should not edit anything directly there, but instead use the CLI or the shell. More information on how to manage entities [here][entities].
|
171
179
|
|
172
180
|
The `plugins` directory can optionally contain project specific plugins. Plugins are a great way to extend `PowerStencil` for the needs of a project or organization.
|
173
181
|
|
@@ -223,6 +231,7 @@ Everyone interacting in the PowerStencil project’s codebases, issue trackers,
|
|
223
231
|
[example use cases]: doc/example_use_cases.md "Example uses cases using PowerStencil"
|
224
232
|
[F.A.Q.]: doc/faq.md "PowerStencil F.A.Q."
|
225
233
|
[status in the F.A.Q.]: doc/faq.md#what-is-the-status-of-powerstencil- "PowerStencil project status"
|
234
|
+
[DB in F.A.Q.]: doc/faq.md#why-is-a-real-database-a-bad-idea-as-configuration-store-for-cicd- "Databases in build processes"
|
226
235
|
[code of conduct]: CODE_OF_CONDUCT.md
|
227
236
|
|
228
237
|
<!-- Code links -->
|
@@ -236,4 +245,5 @@ Everyone interacting in the PowerStencil project’s codebases, issue trackers,
|
|
236
245
|
[ERB]: https://ruby-doc.org/stdlib-2.6.3/libdoc/erb/rdoc/ERB.html "Quick ERB description"
|
237
246
|
[Haml]: http://haml.info/ "The templating engine for XML-like documents"
|
238
247
|
[Ruby]: https://www.ruby-lang.org "The powerful Ruby language"
|
239
|
-
[Rails]: https://rubyonrails.org/ "The Ruby on Rails framework"
|
248
|
+
[Rails]: https://rubyonrails.org/ "The Ruby on Rails framework"
|
249
|
+
[PowerStencil site]: https://powerstencil.brizone.org "Official PowerStencil website"
|
data/doc/builds.md
CHANGED
@@ -16,6 +16,7 @@ Builds
|
|
16
16
|
|
17
17
|
# Overview of the build process
|
18
18
|
|
19
|
+
**:warning: You should have already read the documentation about [templates], before reading this.**
|
19
20
|
|
20
21
|
You build a [buildable] entity by issuing `power_stencil build <entity_type>/<entity_name>`. If you try to build an entity which is not buildable, the process fail with an error message.
|
21
22
|
|
@@ -115,7 +116,7 @@ You may have noticed from the output of `power_stencil info` that there is a typ
|
|
115
116
|
|
116
117
|
This is a very specific type of entity linked to the compilation process.
|
117
118
|
|
118
|
-
The goal of this specific entity is to provide a mechanism to override some of the properties of other entities in the scope of a _build scenario_. This is really a feature turned towards testing possibilities,
|
119
|
+
The goal of this specific entity is to provide a mechanism to override some of the properties of other entities in the scope of a _build scenario_. This is really a feature turned towards testing possibilities, be it for developers or ops, and as such generally `entity_override` are often created as [local entities] (although they really could be created as standard versioned entities).
|
119
120
|
|
120
121
|
Let's create our first override:
|
121
122
|
|
data/doc/entities.md
CHANGED
@@ -10,7 +10,7 @@ Entities
|
|
10
10
|
- [Loose schema entities](#loose-schema-entities)
|
11
11
|
- [Manipulating entities](#manipulating-entities)
|
12
12
|
- [Checking entities](#checking-entities)
|
13
|
-
- [Querying entities](#querying-entities)
|
13
|
+
- [Querying and graphing entities](#querying-and-graphing-entities)
|
14
14
|
- [Creating entities](#creating-entities)
|
15
15
|
- [Versioned entities](#versioned-entities)
|
16
16
|
- [Local (unversioned) entities](#local-unversioned-entities)
|
@@ -226,7 +226,7 @@ RAW ENTITIES
|
|
226
226
|
- Buildable : false
|
227
227
|
```
|
228
228
|
|
229
|
-
## Querying entities
|
229
|
+
## Querying and graphing entities
|
230
230
|
|
231
231
|
The command to query entities from the repository is `power_stencil get`, and it works basically like the `power_stencil check` command.
|
232
232
|
|
@@ -874,7 +874,7 @@ So you see that if we try to set parent with something wrong, the accessor seems
|
|
874
874
|
|
875
875
|
:information_source: The `name` property of the `has_one` directive is optional. If not present the field will be named from the entity_type referenced instead...
|
876
876
|
|
877
|
-
**:information_source: See more advanced features, like the very powerful reverse methods in the [`universe_compiler` advanced relations documentation].**
|
877
|
+
**:information_source: See more advanced features, like the very powerful reverse methods in the [`universe_compiler` advanced relations documentation].** [universe_compiler] is the Gem that manages entities under the hood, but it is much lower level than `PowerStencil`, so unless you are really interested in what happens under the hood, you should not really care about it. Yet you should definitely check what the `with_reverse_method` and `unique` options do to the `has_one` directive.
|
878
878
|
|
879
879
|
#### has_many
|
880
880
|
|
@@ -924,7 +924,7 @@ Which translates at persistence level as:
|
|
924
924
|
```
|
925
925
|
Nice !
|
926
926
|
|
927
|
-
**:information_source: See more advanced features, like the very powerful reverse methods in the [`universe_compiler` advanced relations documentation].**
|
927
|
+
**:information_source: See more advanced features, like the very powerful reverse methods in the [`universe_compiler` advanced relations documentation].** [universe_compiler] is the Gem that manages entities under the hood, but it is much lower level than `PowerStencil`, so unless you are really interested in what happens under the hood, you should not really care about it. Yet you should definitely check what the `with_reverse_method` and `unique` options do to the `has_many` directive.
|
928
928
|
|
929
929
|
|
930
930
|
### buildable and buildable_by
|
data/doc/faq.md
CHANGED
@@ -76,7 +76,8 @@ Regarding `PowerStencil` core:
|
|
76
76
|
|
77
77
|
- The part that may evolve the most is the plugin part (including documentation which is not really in par with the rest...), but it should not break anything developed now.
|
78
78
|
- New system entity types may appear.
|
79
|
-
- The documentation is evolving
|
79
|
+
- The functional documentation is evolving.
|
80
|
+
- There is almost no technical/architectural documentation yet. Read the code...
|
80
81
|
|
81
82
|
Anyway `PowerStencil` follows the semantic versioning pattern and if incompatible changes arise it may be reflected in the version.
|
82
83
|
|
data/doc/plugins.md
CHANGED
@@ -44,7 +44,7 @@ The normal process would be to begin with a plugin within the project and once y
|
|
44
44
|
- Plugins local to the project are automatically taken in account.
|
45
45
|
- To use plugins provided as Gems you have to set the `:plugins:` array property in the `.ps_project/versioned-config.yaml`
|
46
46
|
|
47
|
-
:warning: Plugins provided as standalone Gems are not thoroughly tested, for the time being you may use plugins local to the project.
|
47
|
+
:warning: Plugins provided as standalone Gems are not thoroughly tested, for the time being, you may use plugins local to the project.
|
48
48
|
|
49
49
|
|
50
50
|
# Creating plugin local to the project
|
@@ -145,9 +145,9 @@ MYPLUGIN PLUGIN WAZ HERE
|
|
145
145
|
Wow it worked ! Useless, but worked !
|
146
146
|
|
147
147
|
|
148
|
-
The documentation for plugins is not yet done, so you are encouraged to read the code, the capabilities (in the output of `power_stencil info`) give you an idea of what plugins can do.
|
148
|
+
The documentation for plugins is not yet done, so you are encouraged to read the code, the `capabilities` (in the output of `power_stencil info`) give you an idea of what plugins can do. Some official plugins are under development, and the documentation will be improved along their development...
|
149
149
|
|
150
|
-
|
150
|
+
**:warning: As opposed to the rest of `PowerStencil`, the functionnality is nevertheless not completely frozen. This will be the case once `PowerStencil` turns 1.0.0.**
|
151
151
|
|
152
152
|
|
153
153
|
[:back:][Documentation root]
|
data/doc/templates.md
CHANGED
@@ -19,6 +19,8 @@ Templates
|
|
19
19
|
|
20
20
|
# Templates overview
|
21
21
|
|
22
|
+
**:warning: You should have already read the documentation about [entities], before reading this.**
|
23
|
+
|
22
24
|
Template is a key feature of `PowerStencil` (hence the name). In templates you define how you will use the [entities] you carefully crafted in order to produce something during a [build][builds] process.
|
23
25
|
|
24
26
|
The default templating engine being [ERB], your templates should be written using the [ERB] syntax, like most templates are written in the [Ruby On Rails] framework. This is basically some [Ruby] inside some ERB tags.
|
data/power_stencil.gemspec
CHANGED
@@ -6,12 +6,12 @@ require 'power_stencil/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'power_stencil'
|
8
8
|
spec.version = PowerStencil::VERSION
|
9
|
-
spec.authors = ['Laurent
|
10
|
-
spec.email = ['
|
9
|
+
spec.authors = ['Laurent Briais']
|
10
|
+
spec.email = ['powerstencil-contact@brizone.org']
|
11
11
|
|
12
12
|
spec.summary = %q{PowerStencil is the Swiss-army knife templating workflow for developers and ops.}
|
13
13
|
spec.description = %q{PowerStencil is the Swiss-army knife templating workflow for developers and ops.}
|
14
|
-
spec.homepage = 'https://
|
14
|
+
spec.homepage = 'https://powerstencil.brizone.org'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: power_stencil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Laurent
|
7
|
+
- Laurent Briais
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -111,13 +111,14 @@ dependencies:
|
|
111
111
|
description: PowerStencil is the Swiss-army knife templating workflow for developers
|
112
112
|
and ops.
|
113
113
|
email:
|
114
|
-
-
|
114
|
+
- powerstencil-contact@brizone.org
|
115
115
|
executables:
|
116
116
|
- power_stencil
|
117
117
|
extensions: []
|
118
118
|
extra_rdoc_files: []
|
119
119
|
files:
|
120
120
|
- ".gitignore"
|
121
|
+
- ".gitlab-ci.yml"
|
121
122
|
- ".rspec"
|
122
123
|
- ".travis.yml"
|
123
124
|
- CODE_OF_CONDUCT.md
|
@@ -249,15 +250,15 @@ files:
|
|
249
250
|
- lib/power_stencil/utils/semantic_version.rb
|
250
251
|
- lib/power_stencil/version.rb
|
251
252
|
- power_stencil.gemspec
|
252
|
-
homepage: https://
|
253
|
+
homepage: https://powerstencil.brizone.org
|
253
254
|
licenses:
|
254
255
|
- MIT
|
255
256
|
metadata: {}
|
256
|
-
post_install_message: "\nThank you for installing PowerStencil 0.4.
|
257
|
+
post_install_message: "\nThank you for installing PowerStencil 0.4.8 !\nFrom the command
|
257
258
|
line you can run `power_stencil --help`\nIf your shell is not completing the command:\n
|
258
259
|
\ If you use rbenv: `rbenv rehash`\n If you use zsh : `rehash`\n\nFull documentation
|
259
|
-
here : https://
|
260
|
-
|
260
|
+
here : https://powerstencil.brizone.org/blob/master/README.md\nFeel free to report
|
261
|
+
issues: https://powerstencil.brizone.org/issues\n "
|
261
262
|
rdoc_options: []
|
262
263
|
require_paths:
|
263
264
|
- lib
|