bootstrap-vz/bootstrapvz/plugins/image_commands
Anders Ingemann 953987fddf Combine documentation from github wiki with sphinx
This is the first step in the effort of combining all documentation about
bootstrap-vz into sphinx while still being able to access it from github
(github can parse rst as well)
2015-04-11 16:40:44 +02:00
..
__init__.py Convert every JSON file to YAML 2014-07-09 23:17:04 +02:00
manifest-schema.yml Convert every JSON file to YAML 2014-07-09 23:17:04 +02:00
README.md Execute entries with a single string as shell commands 2015-03-27 11:23:58 -03:00
README.rst Combine documentation from github wiki with sphinx 2015-04-11 16:40:44 +02:00
tasks.py Execute entries with a single string as shell commands 2015-03-27 11:23:58 -03:00

Image script plugin

This plugin gives the possibility to the user to execute commands.

Plugin is defined in the manifest file, plugin section with:

"image_commands": {
    "commands": [ [ "touch", "/var/www/index.html" ]],
}

The commands element is an array of commands. Each command is an array describing the executable and its arguments.

If you need shell expansion of wildcards, like *, just put the entire command as a single entry:

"image_commands": {
    "commands": [ [ "rm -f /tmp/*" ]],
}

Command is executed in current context. It is possible to use variables to access the image or execute chroot commands in the image.

Available variables are: {root} : image mount point (to copy files for example or chroot commands)

Example:

[[ "touch", "{root}/var/www/hello" ],
[ "/usr/sbin/chroot", "{root}", "touch", "/var/www/hello"]]