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:
-
Install Packages that haven’t been installed yet and that are required to deploy the Apps and Accessories in the Site JSON. This includes:
-
the Packages of Apps to be deployed per 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 UBOS Manifest of the Apps and Accessory, for those Roles that are being used on the Device. -
the database engine(s) required for the Apps, if not already installed.
-
-
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):
-
the existing Site will first be suspended;
-
the Site’s frontpage will be replaced with a placeholder saying “upgrade in progress”.
-
the data of all the Apps and Accessories at the Site will temporarily be backed up.
-
if the user requested a backup through the command-line-option, this backup will be exported to the specified destination;
-
all of the previously deployed Site’s Apps and Accessories will be undeployed.
-
-
If the Site hadn’t been deployed previously, the Site’s frontpage will be replaced with a placeholder saying “upgrade in progress”.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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