How to hotfix
Frontastic's Continuous Integration (CI) works based on trunk-based development which means that the master
branch in GitHub always holds the version that will go into production next. So, the CI server only performs a full production build when you push to master
and automatically deploys this to your staging environment.
There might be cases where you can't simply deploy the latest master
build to production. For example, you're currently testing a big new feature that isn't ready to go live yet, but you need to deploy an urgent fix to production. To do this, follow the steps below.
- Find out which version is currently deployed to your production system (open the Frontastic studio, click Developer, then Deployment)
In this example, it's version 2021.07.16.11.37
. Every such version corresponds to a certain commit and tag in your GitHub repository. So, you can easily use it as a starting point for a branch for your fix.
- Create a branch for your fix from the production version:
git checkout -b fix/something-urgent 2021.07.16.11.37
This creates a branch named fix/something-urgent
which starts exactly at the point that's deployed in production.
- Apply your fix, test it properly, and push the branch to the remote repository using:
git push -u origin fix/something-urgent
This will cause the CI server to perform centralized tests on this branch.
This won't build production-ready assets yet. To do this, you'll need to explicitly instruct the CI server by pushing a commit with includes
#build
(see the Continuous Integration article for more information.
- Push a commit including
#build
git commit -m 'ci: #build' --allow-empty ; git push
This command creates an empty commit with just the corresponding message in your branch and pushes it to the remote.
Once the CI server has finished the build successfully, you'll find a new tag in your branch that you can use to trigger a deployment.
-
Deploy your new tag to staging from the Development section in the Frontastic studio (see the rollout section of the deployment article for the steps to do this)
-
Test the fix in staging
-
Roll back to the previous staging version
-
Roll out your fix to production in the Frontastic studio
-
Merge your fix into
master
so it's not lost when you deploy again
Follow the release a hotfix without CI tutorial If you don't want to wait for the CI to release a hotfix.
Updated 12 months ago