Branching and Deployment - TheRestartProject/RepairDirectory GitHub Wiki
We are using a simplified branching structure (not Git Flow) because development typically only involves 1-2 people.
master
is always kept in a state that is ready for merging to production and pushing live.
Development
Features and non-urgent bugs
Features and bug fixes are worked on on branches, and submitted via pull requests.
Internal
If you have write access to the repo.
- Developer creates a branch off of the
develop
branch. - Naming
- begins with the name of the story in Jira, e.g REP-1234, following by an underscore, following by short text reasonably indicative of which issue it relates to, in plain English.
- e.g.
REP-1346_safari-timepicker
- Can push the branch to restarters.dev, and check out to that branch for someone to feature test
- Regularly (e.g. daily) merge develop in to the feature branch
- Once first round of dev is complete, a pull request is created against
develop
from the feature branch- Code review discussion takes place on the PR.
- Review requested from relevant other dev
- When code review complete, merged in to the
develop
branch
External
- via fork and pull request - see Forking Workflow.
Urgent bugs
We use hotfix branches off of master for this.
- when done, merged into
master
anddevelop
- and push to production too, if critical
Releases/Deployment
The code on the live server is deployed by pushing to a "live" repo which lives on the live server under /var/repo/repairdirectory.git. You'll need to have set that up as a remote if you're doing this for the first time.
git checkout develop
git pull
git checkout master
git pull
git merge develop
git push origin master
Pushing to production
From local machine
This assumes you've already done something like:
git remote add live ssh://restarters/var/repo/repairdirectory.git
git checkout production
git pull
git merge master
cp fixometer/config/config.dist.php fixometer/config/config.php
composer install --no-dev
npm install
npm run prod
git add public resources
# 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
git push live production
On server
- Update packages:
cd /srv/users/serverpilot/apps/repairdirectory/
php7.4-sp composer.phar install --no-dev
- run migrations
cd /srv/users/serverpilot/apps/repairdirectory/
php7.4-sp artisan doctrine:migrations:migrate # type 'yes' when prompted
- translations
There is no internationalisation of the Repair Directory Admin, so there's nothing to do.
Smoke tests
For a user who has Repair Directory permissions, check that logging in to Restarters.net and then navigating to https://map.restarters.net/admin logs you in.
On /admin:
- check you can search for and view a business
Also run through the front-end smoke tests here.
Tidying up
Make sure develop
has latest changes from master
for our new sprint:
git checkout develop
git merge master