bootstrap-vz/bootstrapvz/plugins/commands
Anders Ingemann 9364b18288
commands plugin: Run copy files before running commands
This is quite useful in situations where you want to do something
with the assets that you have copied into the image.
One could argue for the opposite case as well, but with the
commands plugin you always have the manual "cp" escape hatch.
2017-08-02 15:42:13 +02:00
..
__init__.py Systematically use rel_path for relative paths 2016-09-12 19:11:20 +02:00
manifest-schema.yml Fix mentions to the commands plugin name 2015-05-02 13:12:33 -03:00
README.rst Fix code block example in commands plugin documentation 2016-05-22 09:14:31 +02:00
tasks.py commands plugin: Run copy files before running commands 2017-08-02 15:42:13 +02:00

Commands
--------------

This plugin allows you to run arbitrary commands during the bootstrap process.
The commands are run at an indeterminate point *after* packages have been
installed, but *before* the volume has been unmounted.

Settings
~~~~~~~~

-  ``commands``: A list of lists containing strings. Each top-level item
   is a single command, while the strings inside each list comprise
   parts of a command. This allows for proper shell argument escaping.
   To circumvent escaping, simply put the entire command in a single
   string, the command will additionally be evaluated in a shell
   (e.g. globbing will work).
   In addition to the manifest variables ``{root}`` is also available.
   It points at the root of the image volume.
   ``required``
   ``manifest vars``

Example
~~~~~~~

Create an empty `index.html` in `/var/www` and delete all locales except english.

.. code-block:: yaml

  commands:
    commands:
      - [touch, '{root}/var/www/index.html']
      - ['rm -rf /usr/share/locale/[^en]*']