Deploy Structure


An ASYD deploy must follow this file structure:

  • A directory named with the name of the deploy (i.e. data/deploys/LAMP/). This name will be displayed on the ASYD web interface on the "Deploys" section.
  • A "def" file (i.e. data/deploys/LAMP/def) with the definition of what the deploy will do - packages to install, commands to execute, configurations to upload, conditions, etc.
  • Optionally, a "def.sudo" file (i.e. data/deploys/LAMP/def.sudo) in case we want to execute this file instead of the standard "def" when using a non-root user (see note below).
  • Optionally, an "undeploy" file (i.e. data/deploys/LAMP/undeploy) with the steps required to revert (undeploy) a Deploy.
  • Optionally, an "undeploy.sudo" file (i.e. data/deploys/LAMP/undeploy.sudo) being the "undeploy" equivalent of "def.sudo".
  • A "configs" directory with the configuration files and folders to be uploaded (i.e. data/deploys/LAMP/configs/apache/apache.conf).

Using the LAMP example (and implying we are inside data/deploys/), the file structure would be something similar to this:

LAMP
 |-def
 |-def.sudo
 |-undeploy
 |-undeploy.sudo
 |-configs
    |-apache
       |-apache.conf

Note about "def.sudo": this definition file will be executed instead of the normal "def" file only in case the user executing on the remote machine is not "root" and this file is present. For the machines where the user is "root", the standard "def" file will be executed regardless the existence of "def.sudo". If this file is not present, the standard "def" file will be executed also for non-root users. This rules also applies to "undeploy.sudo".


The "def" file

Both the "def" and "def.sudo" files, used for defining a deploy, accept any of the commands, variables and conditionals supported by ASYD. The same rules applies for the "undeploy" and "undeploy.sudo" files.

In the next section you can see the commands you can use on this definition files.