Server Setup
Both production and staging servers are set up with the same structure.
.
├── create-release.sh
├── current → (symlink to the deployment currently running on pm2)
├── ecosystem.config.cjs
├── releases/
└── shared/
├── .env
├── public → (symlink to the external mounted media disk — see below)
└── strapi-content-versioning/ (see note below)Notes
-
current→ symlink to the deployment inreleases/that is currently running on pm2. -
shared/public→ symlink to the external mounted disk that hosts the media:- Production:
/mnt/volume_lon1_01/public - Staging:
/mnt/volume_lon1_01/staging/public
(Paths accurate at the time of writing this documentation.)
- Production:
-
shared/strapi-content-versioning/— see Content Versioning.
Create new release
Rollback to old release
- In the root directory of the cms (where the create-release.sh script lives) run:
ln -sfn releases/<release name> current-ssymbolic link,-freplace the existingcurrent,-ndon’t follow the existingcurrentsymlink into its target dir — together they re-pointcurrentatomically.- The target is relative (
releases/…), resolved against wherecurrentlives — not your shell’s cwd — so always run this from the deployment root. Prefer the relative form over an absolute path so the symlink survives the root being moved/mounted elsewhere and the same command works on production and staging. - If another script needs the absolute target, use
readlink -f current/realpath current.
- After confirming that the symlink is pointing in the release you intended to, run again at the root of the cms:
pm2 reload ecosystem.config.cjsLast updated on