As of Elentra ME 1.19, the recommended deployment strategy for deploying Elentra to servers is to use a PHP-based deployment tool called Deployer. The Elentra Deployment Tool v2.0.0 recipe is based off of Deployer v6.8.0, which comes pre-installed with the Elentra Developer Docker environment and can easily be installed on host workstations or CI/CD servers.
To obtain the standard Elentra Deployment Tool template, you can either:
If your local elentra-developer
Docker environment is up to date, then the template already exists on your computer in the ~/Documents/elentra-developers/resources/templates/deployer/v6
directory. If you're not up to date, simply pull down the latest commits from the master
branch.
Alternatively, you can always download the latest from our elentra-developer GitHub repository.
The following describes the default available deployment variables.
Variable | Description |
| Application Name (e.g., |
| Institutional Packagist.com Composer token |
| Branded Edition Elentra ME Git repository location |
| The default deployment branch (e.g., |
| Branded Edition Elentra JS 2.x Git repository location. |
| The default deployment branch (e.g., |
| If you have a Branded Edition Elentra API with your implementation of Elentra then please set this to |
| It is not recommended to change this value. Default value is |
| Local build directory where repositories are stored before deployment. Default value is |
| Array of files or directories removed from host(s) after deployment. Default value is |
| Default stage to be deployed with dep deploy. Default value is |
| Restart supervisord during the deployment process. Requires appropriate permissions. Default value is |
| Exclude any files or directories in Elentra's .deployignore from deployment upload. Default value is |
| Allocate tty for git clone. Default value is |
| Number of previous deployments to keep on the server. Default value is |
For more documentation related to host configuration options, please see the Deployer Hosts documentation, which is quite extensive.
This section illustrates a single server that has multiple Apache virtual hosts defined, which are used for both staging and production.
// Staging Serverhost('elentra.med.university.edu/staging')->stage('staging')->user('staging')->set('branch', 'uni/staging')->set('branch_ejs', 'develop')->set('deploy_path', '/var/www/vhosts/elentra-staging.med.university.edu')->roles('app')->forwardAgent();​// Production Serverhost('elentra.med.university.edu/production')->stage('production')->user('production')->set('branch', 'uni/production')->set('branch_ejs', 'master')->set('deploy_path', '/var/www/vhosts/elentra.med.university.edu')->roles('app')->forwardAgent();
This section illustrates a single staging server and multiple separate production server hosts.
Tip: When deploying to multiple production servers, you should use the -p
or --parallel
flag to deploy to multiple servers at the same time: dep deploy production -p
Deployer also supports host ranges (e.g., elentra[01:05].med.university.edu
).
// Staging Serverhost('elentra-staging.med.university.edu')->stage('staging')->user('staging')->set('branch', 'uni/staging')->set('branch_ejs', 'develop')->set('deploy_path', '/var/www/vhosts/elentra-staging.med.university.edu')->roles('app')->forwardAgent();​// Production Serverhost('elentra01.med.university.edu', 'elentra02.med.university.edu')->stage('production')->user('production')->set('branch', 'uni/production')->set('branch_ejs', 'master')->set('deploy_path', '/var/www/vhosts/elentra.med.university.edu')->roles('app')->forwardAgent();
Deployer deployment commands are typically executed from within your Elentra Developer Docker Environment within the /var/www/vhosts/uni-elentra-1x-me/deployment
directory, but can also be executed by your CI/CD server to automate the deployment process.
Deployer | Notes |
| ​ |
| Add Add |
| ​ |
| Connect via SSH to the specified host. |
Options:-h, --help Display this help message-q, --quiet Do not output any message-V, --version Display this application version--ansi Force ANSI output--no-ansi Disable ANSI output-n, --no-interaction Do not ask any interactive question-f, --file[=FILE] Specify Deployer file--tag=TAG Tag to deploy--revision=REVISION Revision to deploy--branch=BRANCH Branch to deploy--first-run Skips deployment steps not required during initial deployment--force-build Deletes the local build directories and forces a new build-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug​Available commands:autocomplete Install command line autocompletion capabilitiesbuild Build all required application componentscleanup Cleaning up old releasesdeploy Deploy Elentra ME to host(s)help Displays help for a commandinit Initialize deployer in your projectlist Lists commandsrollback Rollback to previous releaserun Run any arbitrary command on hostsself-update Updates deployer.phar to the latest versionssh Connect to host through sshbuildbuild:clean Remove all build directoriesbuild:ejs2 Local: Build Elentra JS 2.x, if requiredbuild:ejs2:clean Local: Remove Elentra JS 2.x local build directorybuild:me Local: Build Elentra MEbuild:me:clean Local: Remove Elentra ME local build directorybuild:prerequisites Local: Test for build prerequisitesconfigconfig:current Show current pathsconfig:dump Print host configurationconfig:hosts Print all hostsdebugdebug:task Display the task-tree for a given taskdeploydeploy:clear_paths Cleaning up files and/or directoriesdeploy:copy_dirs Copy directoriesdeploy:lock Lock deploydeploy:migrate Once: Run database migrations (on first host in stage only)deploy:prepare Preparing host for deploydeploy:release Prepare release. Clean up unfinished releases and prepare next releasedeploy:shared Creating symlinks for shared files and dirsdeploy:symlink Creating symlink to releasedeploy:unlock Unlock deploydeploy:writable Make writable dirsfinalizefinalize:clear_cache Clear the PHP opcode cachefinalize:restart_supervisor Restart supervisord daemon
​