Skip to Content

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 in releases/ 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.)

  • shared/strapi-content-versioning/ — see Content Versioning.

Create new release

Rollback to old release

  1. In the root directory of the cms (where the create-release.sh script lives) run:
ln -sfn releases/<release name> current
  • -s symbolic link, -f replace the existing current, -n don’t follow the existing current symlink into its target dir — together they re-point current atomically.
  • The target is relative (releases/…), resolved against where current lives — 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.
  1. 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.cjs
Last updated on