Adding a new project
Only users with lead developer role have permissions to complete this guide.
- Configure the hosty.yaml file following instructions from the Project configuration documentation page
- Make sure the project codebase is ready for deployment. Usually, it involves installing project dependencies (i.e. composer install or npm install).
- Delete unnecessary files and folders from the project's codebase (i.e. user generated content, local cache files, etc). Otherwise, they will be added to the resulting Docker images, making it heavier and negatively impacting overall deployment time.
The new project will be spun up from the uploaded database and file backups.
Uploading database backup:
The backup must be gzipped before uploading. The command to upload a database backup is:
Where backup.gz is the arbitrary name of your backup.
Uploading files (assets) backup:
Upload user generated files to the hosting by using the following command:
Replace <storageName>with the name of the persistent storage from the hosty.yaml config file. For example, in E.g. public. Repeat this step for every persistent storage configured. For example:
Before running the build command, make sure that all changes in Git for the project are committed. Hosty CLI uses a Git hash to determine whether there have been changes made between builds, therefore building with uncommitted changes may lead to unexpected behavior.
To build the Docker image with the code and create a new environment, run the following command - this may take a couple of minutes, depending on the code and backups size:
Where "production" is the reserved environment name of the main project environment treated as production. All other environment names can be arbitrary and treated as development environments by Hosty (no autoscaling, no replication, no failover, etc).
We recommend matching Git branch names to the environment names for more transparent reference between the code repository and the hosting environments, but it's not required.
To access the deployment environment, run the following command:
It will print public domains assigned to the deployed environment.
If the project is works as expected, create the project backup. It is needed to generate database backup with partial data used to create development environments. Otherwise, development environments will fail to create until the first backup is taken automatically on schedule (3 times a day).