Command: ubos-admin deploy

/docs/gears/developer/understanding/deploy/

Running

To see the supported options, invoke ubos-admin deploy --help.

This command must be run as root (sudo ubos-admin deploy).

Understanding

If the Site JSON file provided to this command is valid, UBOS will perform the following steps:

  1. Install Packages that haven’t been installed yet and that are required to deploy the Apps and Accessories in the Site JSON. This includes:

  2. If the Site has previously been deployed (i.e. the SiteId of a to-be-deployed Site is the same as that of an already-deployed Site; this does not consider the hostname, only the SiteId):

    1. the existing Site will first be suspended;

    2. the Site’s frontpage will be replaced with a placeholder saying “upgrade in progress”.

    3. the data of all the Apps and Accessories at the Site will temporarily be backed up.

    4. if the user requested a backup through the command-line-option, this backup will be exported to the specified destination;

    5. all of the previously deployed Site’s Apps and Accessories will be undeployed.

  3. If the Site hadn’t been deployed previously, the Site’s frontpage will be replaced with a placeholder saying “upgrade in progress”.

  4. If the Site JSON specifies to use a LetsEncrypt certificate, and no valid certificate for this Site is available on the Device, certbot will automatically contact the LetsEncrypt web service and attempt to obtain a valid certificate for the Site. This involves the temporary publication of a challenge document in the Site‘ss .well-known subdirectory.

    If a valid certificate was found or obtained, the Site will then be set up with it. If no valid certificate could be obtained (e.g. because LetsEncrypt could not contact the device due to DNS problems or a lack of public IP address, per LetsEncrypt requirements), Site will still be set up, but without SSL/TLS and after emitting a warning message.

  5. If the Site specifies TLS (not LetsEncrypt) but no key or certificate was provided as part of the Site JSON, a self-signed key/certificate pair will be automatically generated.

  6. All the Apps and Accessories specified in the new Site JSON will be deployed. For each of them, the UBOS Manifest is processed. For each of the Roles in each UBOS Manifest, each of the AppConfigItems is deployed: files are copied, directories created, databases provisioned and populated, and scripts run. The Roles are processed in the sequence from backend to frontend, so that, for example, at the time the Apache Role is processed, the setup of a MySQL database is already complete.

  7. If the Site had been previously deployed on this Device, the previously backed-up data will be restored to those AppConfigurations in the Site that still exist; then, the “upgrade” scripts will be run that were specified by the Apps and Accessories in their respective of UBOS Manifest.

  8. If an App or Accessory at the Site had not previously been deployed, the “installer” scripts will be run instead that were specified by the Apps and Accessories in their respective of UBOS Manifest.

  9. The frontpage of the Site will be re-enabled.

This command also accepts the --template flag. In this case, ubos-admin deploy allows the provided Site JSON file to leave out information such as SiteIds and AppConfigIds, and automatically generate new ones before deploying the Site

See also: