Prerequisites
- SSH access to your servers
- deployer 8 installed on your local system
- deployer8-silverstripe6.php script present somewhere in your local filesystem
- mandatory:
composer,aclandrsyncinstalled on your servers - reccomended:
cachetoolandunzipinstalled on your servers
What you need to configure manually
This deployment strategy is webserver and database agnostic. You must preemptively configure webserver and database by yourself.
Keep in mind if your deploy_path is /path/to/production, Silverstripe will be installed under /path/to/production/current.
How to deploy
Create a deploy.yaml file in the root of your Silverstripe project.
import: /path/to/deployer8-silverstripe6.php
hosts:
staging:
hostname: mystagingserver
keep_releases: 1
deploy_path: '/path/to/staging'
production:
hostname: myproductionserver
deploy_path: '/path/to/production'
Create different environments to match the various hosts: .env for development, .env.staging for staging and .env.production for production. You can theoretically have as many hosts as you want: staging and production are just two names I use by convention.
If everything is configured properly, you should be able to:
dep deploy staging # Deploy to staging host
dep deploy production # Deploy to production host
dep rollback production # Rollback to previous version
dep backup production # Download both assets and database dump