bcd_cli.md 17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# BCD command-line interface

On this page you will find detailed information about the BCD CLI with usage examples and reference.


## Requirements

* First, the `bcd` command requires that the **`BCD_HOME`** environment variable is set.  
By default `BCD_HOME` is set to `/home/bonita/bonita-continuous-delivery` in the controller container.
* Next, the `bcd` command takes a mandatory option called `scenario` through the `-s / --scenario` command line option.  
This option expects an existing relative or absolute path to a [BCD YAML scenario](scenarios.md) file.  
The BCD scenario path can also be specified through the **`BCD_SCENARIO`** environment variable, hence allowing to skip the `-s / --scenario` command line option.
* Finally, the BCD CLI expects to find Bonita version-specific dependencies in the **`$BCD_HOME/dependencies`** directory. This directory must contain:
    - `bonita-la-builder-*-exec.jar` - (Mandatory) The Bonita Living Application Builder library
    - `bonita-sp-*-maven-repository.zip` - (Optional) The Bonita Maven repository zip if required by your Living Application workspace.
16
BCD dependencies may be retrieved as `bonitasoft/bcd-dependencies` Docker images and they must be mounted as volumes in the `$BCD_HOME/dependencies` directory.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42


## Usage examples

Running the `create` subcommand of the `stack` command with scenario command-line option:
```
$ bcd -s scenarios/uswest2_cluster.yml stack create
```

Running the `deploy` subcommand of the `stack` command with scenario command-line option and overridden `mail_notification` variable:
```
$ bcd -s scenarios/vagrant_single.yml -e mail_notification=no -y stack deploy
```

Running the `destroy` subcommand of the `stack` command with `BCD_SCENARIO` environment variable and subcommand `--dry-run` option:
```
$ export BCD_SCENARIO=scenarios/uswest2_performance.yml
$ bcd stack destroy --dry-run
```

Running the `build` subcommand of the `livingapp` command with `BCD_SCENARIO` environment variable and subcommand `-p` and `-e` options:
```
$ export BCD_SCENARIO=scenarios/euwest1_performance.yml
$ bcd livingapp build -p path/to/livingapp-repo -e Qualification
```

43 44 45 46 47
Running the `version` command which does not require a scenario file:
```
$ bcd version
```

48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75

## Multi command chaining

The BCD CLI allows to invoke more than one command in one go. This is useful to chain commands as a pipeline.

If one command fails then `bcd` stops executing any subsequent command it may have.

**Examples**:

Running `create` then `deploy` subcommands of the `stack` command:
```
$ bcd -s scenarios/uswest2_cluster.yml -y stack create deploy
```

Running `build` then `deploy` subcommands of the `livingapp` command:
```
$ bcd -s scenarios/vagrant_single.yml --yes \
    livingapp build -p path/to/livingapp-repo -e Qualification deploy
```


## Command-line reference

This section describes the comprehensive usage information for the `bcd` command.

You can also see this information by running `bcd --help` and `bcd [SUBCOMMAND] --help` - where SUBCOMMAND is in `[livingapp, stack]` - from the command line.

<div class="section" id="bcd">
76
<span class="h3">bcd</span>
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
<p>Bonita Continuous Delivery CLI.</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd <span class="o">[</span>OPTIONS<span class="o">]</span> COMMAND <span class="o">[</span>ARGS<span class="o">]</span>...
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-v">
<code class="descname">-v</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--verbose</code><code class="descclassname"></code></dt>
<dd><p>Enable Ansible verbose mode</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-y">
<code class="descname">-y</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--yes</code><code class="descclassname"></code></dt>
<dd><p>Execute action without confirmation prompt</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-nocolor">
<code class="descname">--nocolor</code><code class="descclassname"></code></dt>
<dd><p>Turn output colorization off</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-s">
<code class="descname">-s</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--scenario</code><code class="descclassname"> &lt;scenario&gt;</code></dt>
<dd><p>YAML scenario file path - Optional if <cite>BCD_SCENARIO</cite> environment variable is defined.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-e">
<code class="descname">-e</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--extra-vars</code><code class="descclassname"> &lt;extra_vars&gt;</code></dt>
<dd><p>Extra vars for Ansible (multiple) - Variables are passed using the key=value syntax.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

118 119 120 121 122 123
<dl class="option">
<dt id="cmdoption-bcd-version">
<code class="descname">--version</code><code class="descclassname"></code></dt>
<dd><p>Show the version and exit.</p>
</dd></dl>

124
<div class="section" id="bcd-livingapp">
125
<h4>livingapp</h4>
126 127 128 129 130 131 132 133 134 135 136 137
<p>Manage Bonita Living Application</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd livingapp <span class="o">[</span>OPTIONS<span class="o">]</span> COMMAND1 <span class="o">[</span>ARGS<span class="o">]</span>... <span class="o">[</span>COMMAND2 <span class="o">[</span>ARGS<span class="o">]</span>...<span class="o">]</span>...
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-livingapp-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

<div class="section" id="bcd-livingapp-build">
138
<h5>build</h5>
139 140 141 142 143 144 145 146
<p>Build Bonita Living Application</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd livingapp build <span class="o">[</span>OPTIONS<span class="o">]</span>
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-livingapp-build-p">
<code class="descname">-p</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--path</code><code class="descclassname"> &lt;path&gt;</code></dt>
147
<dd><p>Bonita Living Application repository path</p>
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-build-e">
<code class="descname">-e</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--environment</code><code class="descclassname"> &lt;environment&gt;</code></dt>
<dd><p>Name of the process configuration environment as defined in Bonita Studio</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-build-x">
<code class="descname">-X</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--debug</code><code class="descclassname"></code></dt>
<dd><p>Enable debug mode</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-build-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

</div>
<div class="section" id="bcd-livingapp-deploy">
170
<h5>deploy</h5>
171 172 173 174 175 176 177 178
<p>Deploy Bonita Living Application</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd livingapp deploy <span class="o">[</span>OPTIONS<span class="o">]</span>
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-livingapp-deploy-p">
<code class="descname">-p</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--path</code><code class="descclassname"> &lt;path&gt;</code></dt>
179 180 181 182 183 184 185
<dd><p>Bonita Living Application archive or directory path</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-deploy-c">
<code class="descname">-c</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--configuration-path</code><code class="descclassname"> &lt;configuration_path&gt;</code></dt>
<dd><p>Bonita configuration (.bconf) archive path</p>
186 187 188 189 190 191 192 193 194 195 196 197 198 199
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-deploy-x">
<code class="descname">-X</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--debug</code><code class="descclassname"></code></dt>
<dd><p>Enable debug mode</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-deploy-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
</div>
<div class="section" id="bcd-livingapp-extract-conf">
<h5>extract-conf</h5>
<p>Extract parameters from a Bonita configuration archive (.bconf)</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd livingapp extract-conf <span class="o">[</span>OPTIONS<span class="o">]</span>
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-livingapp-extract-conf-p">
<code class="descname">-p</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--path</code><code class="descclassname"> &lt;path&gt;</code></dt>
<dd><p>Bonita configuration (.bconf) archive path</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-extract-conf-without-value">
<code class="descname">--without-value</code><code class="descclassname"></code></dt>
<dd><p>Only extract parameters which do not have a value</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-extract-conf-o">
<code class="descname">-o</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--output</code><code class="descclassname"> &lt;output&gt;</code></dt>
<dd><p>Output file</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-extract-conf-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

</div>
<div class="section" id="bcd-livingapp-merge-conf">
<h5>merge-conf</h5>
<p>Merge parameters into a Bonita configuration archive</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd livingapp merge-conf <span class="o">[</span>OPTIONS<span class="o">]</span>
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-livingapp-merge-conf-p">
<code class="descname">-p</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--path</code><code class="descclassname"> &lt;path&gt;</code></dt>
<dd><p>Bonita configuration (.bconf) archive path</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-merge-conf-i">
<code class="descname">-i</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--input</code><code class="descclassname"> &lt;input&gt;</code></dt>
<dd><p>Input parameter file</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-merge-conf-o">
<code class="descname">-o</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--output</code><code class="descclassname"> &lt;output&gt;</code></dt>
<dd><p>Output file</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-livingapp-merge-conf-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

264 265 266
</div>
</div>
<div class="section" id="bcd-stack">
267
<h4>stack</h4>
268 269 270 271 272 273 274 275 276 277 278 279
<p>Manage Bonita stack (infrastructure)</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd stack <span class="o">[</span>OPTIONS<span class="o">]</span> COMMAND1 <span class="o">[</span>ARGS<span class="o">]</span>... <span class="o">[</span>COMMAND2 <span class="o">[</span>ARGS<span class="o">]</span>...<span class="o">]</span>...
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-stack-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

<div class="section" id="bcd-stack-create">
280 281
<h5>create</h5>
<p>Create infra machines</p>
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd stack create <span class="o">[</span>OPTIONS<span class="o">]</span>
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-stack-create-d">
<code class="descname">-d</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--dry-run</code><code class="descclassname"></code></dt>
<dd><p>Show an execution plan only</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-stack-create-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

</div>
<div class="section" id="bcd-stack-deploy">
300
<h5>deploy</h5>
301 302 303 304 305 306 307 308 309 310 311 312 313
<p>Deploy Bonita stack (creates Docker containers)</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd stack deploy <span class="o">[</span>OPTIONS<span class="o">]</span>
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-stack-deploy-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

</div>
<div class="section" id="bcd-stack-destroy">
314 315
<h5>destroy</h5>
<p>Destroy infra machines</p>
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd stack destroy <span class="o">[</span>OPTIONS<span class="o">]</span>
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-stack-destroy-d">
<code class="descname">-d</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--dry-run</code><code class="descclassname"></code></dt>
<dd><p>Show an execution plan only</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-bcd-stack-destroy-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

</div>
<div class="section" id="bcd-stack-status">
334
<h5>status</h5>
335 336 337 338 339 340 341 342 343 344 345 346 347
<p>Show the platform status</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd stack status <span class="o">[</span>OPTIONS<span class="o">]</span>
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-stack-status-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

</div>
<div class="section" id="bcd-stack-undeploy">
348
<h5>undeploy</h5>
349 350 351 352 353 354 355 356 357 358 359 360
<p>Undeploy Bonita stack (removes Docker containers)</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd stack undeploy <span class="o">[</span>OPTIONS<span class="o">]</span>
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-stack-undeploy-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

</div>
361 362
</div>
<div class="section" id="bcd-version">
363
<h4>version</h4>
364 365 366 367 368 369 370 371 372 373 374
<p>Show BCD version information</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>bcd version <span class="o">[</span>OPTIONS<span class="o">]</span>
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="option">
<dt id="cmdoption-bcd-version-h">
<code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code></dt>
<dd><p>Show this help message</p>
</dd></dl>

375 376
</div>
</div>