How to hotfix

Frontastic's Continuous Integration (CI) works on the basis of 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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)

  2. Test the fix in staging

  3. Roll back to the previous staging version

  4. Roll out your fix to production in the Frontastic studio

  5. Merge your fix into master so it's not lost when you deploy again


Did this page help you?