In Atomic Deployment, the Deployment Script allows you to deploy your web application without any downtime or errors. It consists of three main steps:

  1. Cloning a new release
  2. Installing Composer dependencies
  3. Activating the latest release.

These steps are essential to make your site run smoothly. However, depending on your specific needs, you may need to perform some additional tasks before or after the main steps.

Understanding Deployment Scripts

You can customize and extend the deployment process by adding your own tasks in the deployment script. You can specify when to run your tasks, either before or after the main steps.

Cloning a new release

This is the first step of the deployment process. It clones your latest code from your Git repository to a new release folder. After cloning, it also creates symlinks for the folders and files that you have configured in the symlink menu.

Installing Composer dependencies

This is the second step of the deployment process. It installs the Composer dependencies for your web application. You can choose whether to install the dependencies or not, and whether to include the dev dependencies or not, in the General Setting.

Activating the latest release

This is the final step of the deployment process. It switches your live folder to point to the new release folder. This way, your site will use the latest code without any interruption.

Writing your deployment script

When you write a deployment script, you can choose when to run your script based on the three basic tasks. You can place your custom script before or after running the main tasks.

With Atomic Git Deployment, you don’t have to worry about clearing the PHP Opcache manually. We will do it for you automatically without needing to reload your PHP engine manually.

Replacer Tags

To make your deployment script easier to write, we provide you with a Replacer functionality. It is a set of placeholders that will be replaced with the actual values during the deployment process.

Please note that the Replacer for PHP is not available for Containerized server because it will use the PHP version of the Web Application.

ReplacerDescription
{ROOTPATH}The path to /home//webapps/
{RELEASE}The current release version being deployed
{RELEASEPATH}The path to /home//webapps//releases/{RELEASE}
{CONFIGPATH}The path to /home//webapps//configs
{STORAGEPATH}The path to /home//webapps//storage
{PHP55}Run PHP-CLI using /RunCloud/Packages/php55rc/bin/php
{PHP56}Run PHP-CLI using /RunCloud/Packages/php56rc/bin/php
{PHP70}Run PHP-CLI using /RunCloud/Packages/php70rc/bin/php
{PHP71}Run PHP-CLI using /RunCloud/Packages/php71rc/bin/php
{PHP72}Run PHP-CLI using /RunCloud/Packages/php72rc/bin/php
{PHP73}Run PHP-CLI using /RunCloud/Packages/php73rc/bin/php
{PHP74}Run PHP-CLI using /RunCloud/Packages/php74rc/bin/php
{PHP80}Run PHP-CLI using /RunCloud/Packages/php80rc/bin/php
{PHP81}Run PHP-CLI using /RunCloud/Packages/php81rc/bin/php
{PHP82}Run PHP-CLI using /RunCloud/Packages/php82rc/bin/php
{PHP83}Run PHP-CLI using /RunCloud/Packages/php83rc/bin/php

For example, here is a code snippet that uses the replacer tags:

cd {RELEASEPATH}
{PHP82} artisan migrate --force

During execution, the above code will be translated to this:

cd /home/runcloud/webapps/myproject/releases/1536424572396
/RunCloud/Packages/php82rc/bin/php artisan migrate --force