ubos-admin deployΒΆ

See also Command reference.

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

  1. Install required packages that haven’t been installed yet. This includes:

    • the packages of Apps to be deployed per the the Site JSON, but not yet installed on the device;
    • the packages of Accessories to be deployed per the Site JSON, but not yet installed on the device;
    • dependencies of those packages as listed in the respective PKGBUILD files;
    • packages listed in the depends section of the manifest JSONs of the App and Accessories, for those roles that are being used on the device.
    • the database engine(s) required for the App, if not already installed.
  2. If the Site has previously been deployed, the existing Site will first be suspended, and the data of all the Apps and Accessories at the Site will temporarily be backed up.

  3. The Site‘s frontpage will be replaced with a placeholder saying “upgrade in progress”.

  4. If the Site has previously been deployed, all Apps and Accessories at the deployed Site will be undeployed.

  5. If a backup was requested, the backup will be created.

  6. If the Site specifies to use a LetsEncrypt certificate, and no valid certificate 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 document in the Site‘s .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), the Site will still be set up, but without SSL/TLS.

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

  8. All the Apps and the Accessories in the new Site JSON will be deployed. For each of them, the manifest JSONs is processed for each of the roles, and each of the AppConfigItems is deployed: files are copied, directories created, databases provisioned and populated, and scripts run.

  9. If an App at the Site was previously deployed, the previously backed-up data will be restored, and the “upgrade” scripts will be run that were specified by the App and any Accessories.

  10. If an App at the Site was not previously deployed, the “installer” scripts will be run that were specified by the App and any Accessories.

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

UBOS uses the siteid and the appconfigid fields in the Site JSON to determine whether a Site and/or an AppConfiguration is being newly deployed, redeployed or undeployed. This makes it easy to move a Site from one hostname to another (the Site JSON is the same with the same siteid and appconfigid, but a changed hostname), or to move an App from one context path to another (the appconfigid is the same, just the context is different).

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

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