1RBM_STEPS(7)                                                      RBM_STEPS(7)
2
3
4

NAME

6       rbm_steps - rbm steps configuration
7

DESCRIPTION

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

CONFIGURATION

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 if you
24       want to use a different git tag or branch for rpm and debian packages,
25       you could do:
26
27           git_hash: |
28            [% IF c('step') == 'rpm' -%]
29            dev-rpm
30            [%- ELSIF c('step') == 'deb' -%]
31            dev-deb
32            [%- ELSE -%]
33            dev
34            [%- END -%]
35
36       An other way to do it is to use steps option. This option works in a
37       similar way to the targets option except that it contains a hash
38       indexed by step name rather than a hash indexed by target name..
39
40       The steps configuration can be defined in any of the configuration
41       files, using the steps option. This option is an hash, with the steps
42       names as keys, and as value an other hash containing the options to be
43       used for this step.
44
45       A project which should use a different git tag or branch depending on
46       whether we are building an rpm or deb package could be defined in the
47       following way:
48
49           git_hash: dev
50           steps:
51             rpm:
52               git_hash: dev-rpm
53             deb:
54               git_hash: dev-deb
55
56       It is also possible to combine step based configuration with target
57       configuration. For instance you could do:
58
59           targets:
60             stable:
61               git_hash: stable
62             dev:
63               git_hash: dev
64           steps:
65             rpm:
66               targets:
67                 stable:
68                   git_hash: stable-rpm
69                 dev:
70                   git_hash: dev-rpm
71             deb:
72               targets:
73                 stable:
74                   git_hash: stable-deb
75                 dev:
76                   git_hash: dev-deb
77
78       If the value of a step is not a hash containing options, but a string,
79       then this name is used as step name. This can be used to alias a step
80       configuration to an other step. For instance you usually want to use
81       the same options for the rpm and srpm scripts. The default
82       configuration includes the following steps aliases:
83
84       ·   srpm: rpm
85
86       ·   deb-src: deb
87

PRE AND POST SCRIPTS

89       Before starting some build script, you often need to prepare the host
90       for the build. Usually this means installing some dependencies required
91       for the build. After the build finished, you might want to remove those
92       dependencies that have been added.
93
94       This can be done using the pre and post options. Those options contains
95       a script that is run as root before and after the build. Those options
96       can be defined globally, or per step.
97
98       The pre and post scripts are expected to be run as root. To do that,
99       they are run using the suexec option if run locally, or if run using
100       the remote_exec option the exec_as_root option is set to true. The
101       suexec option takes the suexec_cmd option and runs it as root. By
102       default, the suexec option uses sudo.
103

SEE ALSO

105       rbm(1), rbm_config(7)
106
107
108
109                                  02/02/2019                      RBM_STEPS(7)
Impressum