- Copy
.circleci
folder from a previous project - Run
composer require deployer/recipes --dev
to install the required rysnc Deployer recipe - Copy
deploy.php
from the root directory of a previous project - Create a
.env.testing
file based on the.env.example
but replace the following properties:
APP_ENV=testing
APP_DEBUG=true
APP_LOG_LEVEL=debug
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=:memory:
DB_USERNAME=circleci
DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
- Edit the
deploy.php
file - Set the application name to a logical name (this will be used for the folder name on the server in public_html)
- Update the repository URL to the new one which can be found by clicking on clone within the repo on Bitbucket
- Add any folders that should remain between deployments to the
shared_dirs
function e.g. a folder with a lot of photos which wouldn't be in the git repo - Check that the appropriate files and folders are within the exclude list (these will not be transferred from the build server to the production server)
- If the application will live under a separate cPanel account, change the
user
property under each host to match the account name. You would also need to copy the files from the.ssh
directory under the previous account to the new account, or create new keys and add the key to the CircleCI account to get the fingerprint and replace the current fingerprint in.circleci/config.yml
- If you are using Laravel Telescope, make sure to add
<env name="TELESCOPE_ENABLED" value="false"/>
tophpunit.xml
so that tests will pass - Commit the changes you've made and push them to the repo
- Log in to CircleCI with your Bitbucket account
- Click on
Set up project
withinAdd Projects
, and then click onStart Building
- Open up the settings for the project, and click on
SSH Permissions
, add the SSH private key with a hostname that matches thedeploy.php
hostname - Trigger a build or push a commit and monitor the output on CircleCI
- SSH onto the server and
cd
into theshared
directory to edit the.env
file with appropriate values
Then you should be good to go!