How to release a hotfix without the CI
In the How to hotfix article, you learned to release a hotfix using the CI, but sometimes the hotfix is too urgent to even wait for the CI. This article describes how you can do a production deployment in case they need to deploy a critical fix without waiting for the CI to finish.
Advanced users only
This article is meant for the advanced users of Frontastic.
Create a build version
To release the hotfix, you need to create a new build version of the format yyyy.mm.dd.hh.mm
. So, for example, 2022.10.09.11.43
, if you release on 9 October 2022 at 11:43.
Update the version=
variable in the environment
file in the repository's root with this value.
Build frontend assets
You can skip this step if the hotfix only contains backend changes.
To build the frontend, you need a Frontastic sandbox for your project that's set up correctly (frontastic init
).
- Start the file synchronization with a sandbox (
frontastic run
) and connect to the sandbox using SSH (frontastic ssh
) - Update
version
value in theenvironment
file on the sandbox as this isn't done automatically byfrontastic run
- Change to the project directory (
<customer name>_<project name>
) - Run the following command in the project directory on the sandbox to build the server-side rendering application
yarn install
CI=false PUBLIC_URL=/ yarn run build server
- Copy the newly built
server.js
(andserver.js.map
if applicable) files from thebuild/assets/js/
directory on the sandbox to thebin/
directory of your project. You can use a tool likescp
to do this. - Run the following command on the sandbox to build the client-side assets
CI=false PUBLIC_URL=/ yarn run build main
- Copy the newly built artifacts, including the
assets/
directory and theservice-worker.js
file from thebuild/
folder on the sandbox to thepublic/
directory on your system. Based on your setup, you might need to replace additional files. - Update all asset references in the
templates/layout.html.twig
file in the project directory. Based on your setup, the template might reference the.js
and.css
files by filename, including the hash of the assets.
Commit and Tag
Commit all changes, including the updated environment
file, the new build assets, and the template. Now, create a Git tag with the version number created earlier as it's name and push the commit and the tag to the GitHub repository.
Deploy the hotfix
- Go to the Developer > Deployment page in the studio and copy the
curl
command at the bottom. For example,
curl -X POST --cookie 'some-cookie-value' --header 'Content-Type: application/json' -d '{"tag": "####.##.##.##.##"}' 'https://<your-studio-url>/api/deployment/schedule?environment=env'
Don't share the
curl
commandThe
curl
command copied from the studio contains the cookie with the studio authentication information. So, it's critical to treat it as a secret and not share the command with anyone else.
- Add the new version number in the
tag
property of the JSON body. And replace theenv
at the end of the URL with the environment which should be deployed needs to be set at the end (based on your setup, probablyproduction
orstaging
). - Run the
curl
command can be executed to trigger a deployment of the newly built release.
Updated about 1 year ago