You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+42-1Lines changed: 42 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,20 @@ The first step of any change proposal is to open an issue about it. This gives a
32
32
33
33
To cover the vast majority of typical discussion points in advance, there are predefined templates for issues and pull requests. Please make sure to use them in order to streamline the workflow.
34
34
35
-
If something comes up that is not a good fit for the templates, that's probably already an early indicator that it should be discussed more closely. In this case please contact us first, or at least provide a reasoning about why the template had to be ignored in that specific case.
35
+
If something comes up that is not a good fit for the templates, that's probably already an early indicator that it should be discussed more closely. In this case please [contact us](https://www.rexify.org/support/index.html) first, or at least provide a reasoning about why the template had to be ignored in that specific case.
36
+
37
+
### Rex core vs extending Rex
38
+
39
+
Strictly speaking the core competency of Rex is to execute commands, manage files, define tasks, and orchestrate their execution.
40
+
41
+
Rex gained lots of other capabilities over time, and historically many of them landed in core as well. But it is often possible to extend Rex by only minimally changing the core, if at all. For example this includes adding support to:
42
+
43
+
- manage new operating systems
44
+
- new shell types
45
+
- new virtualization methods
46
+
- new cloud providers
47
+
48
+
It is highly encouraged to add such new capabilities via their own extension modules outside the core. If in doubt, please check some of the common scenarios below, or [contact us](https://www.rexify.org/support/index.html).
36
49
37
50
### Cross platform support
38
51
@@ -183,6 +196,34 @@ It is generally recommended to:
183
196
-[rebase](https://docs.github.com/en/github/using-git/about-git-rebase) your feature branch on top of the default branch if there are new commits since the feature branch has been created
184
197
- use follow up/clean up commits on the same PR, but then please also [squash related commits](https://docs.github.com/en/github/using-git/about-git-rebase) together in the feature branch _before_ merging in order to keep a tidy history (in other words, no "tidy only" or "fix typo" commits are necessary)
185
198
199
+
## Common scenarios
200
+
201
+
### Add support to manage new operating systems
202
+
203
+
Allowing Rex to manage a new OS requires the following steps:
204
+
205
+
1. Teach rex about how to detect the given OS
206
+
207
+
- add a way to `Rex::Hardware::Host::get_operating_system()` to detect the given OS
208
+
- add a new `is_myos()` function to `Rex::Commands::Gather`
209
+
210
+
1. Let Rex choose the proper package and service management modules for the given OS
211
+
212
+
- modify `Rex::Service` and `Rex::Pkg`
213
+
214
+
1. Add new service and package management modules specific to the given OS
215
+
216
+
- add `Rex::Service::MyOS`
217
+
- add `Rex::Pkg::MyOS`
218
+
219
+
### Add support for new virtualization methods
220
+
221
+
Assuming the new virtualization method is called `MyVirt`, the following steps are required:
222
+
223
+
- create the top-level `Rex::Virtualization::MyVirt` module which includes the constructor, and the documentation
224
+
- create submodules for each virtualization command, e.g. `Rex::Virtualization::MyVirt::info`
225
+
- implement the logic of the given command as the `execute` method
226
+
186
227
## Contribute to this guide
187
228
188
229
If you think some of the information here is outdated, not clear enough, or have bugs, feel free to contribute to it too!
0 commit comments