-
Notifications
You must be signed in to change notification settings - Fork 4
Deployment
The code on the live server is deployed by pushing to a "live" repo which lives on the live server under /var/repo/restarters.git. You'll need to have set that up as a remote if you're doing this for the first time. See internal Server & Deployment doc for more info.
git checkout develop
git pull
git checkout master
git pull
git merge develop
git push origin master
This will trigger a build on CircleCI - wait and check this works.
We have a production
branch that functions as a build and deploy branch. Assets and dependencies are built and installed locally (e.g. via npm build / composer installs etc) and committed to this branch in order to get pushed to production. We don't build on production. These assets and dependencies are not checked in to other branches.
(Note: in order to push to the production server, you will already need to have set it up as a remote. e.g. git remote add live ssh://restarters/var/repo/restarters.git
.)
git checkout production
git pull
git merge master
# Do a diff to check if any new .env values need setting up on prod - if so, they will need to be added manually.
<diff-tool-of-choice> .env.example .env
php composer.phar install --no-dev
npm install
export NODE_OPTIONS=--max-old-space-size=8192; npm rebuild node-sass; npm run prod
git add public resources vendor node_modules composer.lock composer.json package.json package-lock.json
# Note: next step may fail with 'nothing to commit, working tree clean' if npm run prod didn't produce any changes
git commit -m "Build assets"
git push origin production
This will trigger a CircleCI build. Wait for that to complete.
NOTE: Lately we've had a few oddities occurring during push to production, related to vendor files.
So for now, before pushing, take a backup on the server that we can easily restore to if something goes wrong:
ssh restarters
cd /srv/users/serverpilot/apps
sudo cp -r restarters restarters.`date +"%Y-%m-%d"`
git push live production
- run migrations
cd /srv/users/serverpilot/apps/restarters/
echo yes | php7.4-sp artisan migrate
php7.4-sp artisan view:clear
- translations
Import newly added translations to the translation manager:
php7.4-sp artisan translations:import
- .env
If any new values flagged for addition from diff step earlier on, add them in to .env.
php artisan queue:restart
First check top level sections look OK. (i.e. click through Fixometer, Events, Groups sections), and anything relevant to the specific release that might need an extra look at.
Then run through tests at https://github.com/TheRestartProject/restarters.net/wiki/Regression-Testing.
Monitor Sentry over the next couple of hours to spot any sudden breakages.
Make sure develop
has latest changes from master
for our new sprint:
git checkout develop
git pull
git merge master
git push origin develop
If something went wrong during deployment of code (and assuming you took the folder backup earlier):
sudo mv restarters restarters.broken
sudo cp -r restarters.`date +"%Y-%m-%d"` restarters