1RBM_STEPS(7) RBM_STEPS(7)
2
3
4
6 rbm_steps - rbm steps configuration
7
9 When you define some project, you can have more than one script
10 definition, for the different steps of the build process (build, test,
11 publish, etc ...), or for different types of packaging (rpm, deb, etc
12 ...).
13
14 All the configuration options are shared between all those scripts.
15 However, in some cases you may want some option to have a different
16 value depending of the script that we are running. The name of the
17 script we are going to be running is called the step, and it is
18 possible to have different option values depending on the current step.
19
21 The first way to have a different option value depending on the curernt
22 step is to use the IF/ELSE template directives and the step option. The
23 step option contains the name of the current step. For instance,
24 assuming that you defined rpm and deb steps for building rpm and debian
25 packages, if you want to use a different git tag or branch depending on
26 the type of package, you could do:
27
28 git_hash: |
29 [% IF c('step') == 'rpm' -%]
30 dev-rpm
31 [%- ELSIF c('step') == 'deb' -%]
32 dev-deb
33 [%- ELSE -%]
34 dev
35 [%- END -%]
36
37 An other way to do it is to use steps option. This option works in a
38 similar way to the targets option except that it contains a hash
39 indexed by step name rather than a hash indexed by target name..
40
41 The steps configuration can be defined in any of the configuration
42 files, using the steps option. This option is an hash, with the steps
43 names as keys, and as value an other hash containing the options to be
44 used for this step.
45
46 A project which should use a different git tag or branch depending on
47 whether we are building an rpm or deb package could be defined in the
48 following way:
49
50 git_hash: dev
51 steps:
52 rpm:
53 git_hash: dev-rpm
54 deb:
55 git_hash: dev-deb
56
57 It is also possible to combine step based configuration with target
58 configuration. For instance you could do:
59
60 targets:
61 stable:
62 git_hash: stable
63 dev:
64 git_hash: dev
65 steps:
66 rpm:
67 targets:
68 stable:
69 git_hash: stable-rpm
70 dev:
71 git_hash: dev-rpm
72 deb:
73 targets:
74 stable:
75 git_hash: stable-deb
76 dev:
77 git_hash: dev-deb
78
79 If the value of a step is not a hash containing options, but a string,
80 then this name is used as step name. This can be used to alias a step
81 configuration to an other step. For instance you usually want to use
82 the same options for the rpm and srpm scripts, which can be done with
83 the following step alias:
84
85 • srpm: rpm
86
88 Before starting some build script, you often need to prepare the host
89 for the build. Usually this means installing some dependencies required
90 for the build. After the build finished, you might want to remove those
91 dependencies that have been added.
92
93 This can be done using the pre and post options. Those options contains
94 a script that is run as root before and after the build. Those options
95 can be defined globally, or per step.
96
97 The pre and post scripts are expected to be run as root. To do that,
98 they are run using the suexec option if run locally, or if run using
99 the remote_exec option the exec_as_root option is set to true. The
100 suexec option takes the suexec_cmd option and runs it as root. By
101 default, the suexec option uses sudo.
102
104 rbm(1), rbm_config(7)
105
106
107
108 07/25/2022 RBM_STEPS(7)