rollback.yml uses git checkout which does not work for symlink-based PHP deployments #5

Open
opened 2026-05-26 09:25:52 -06:00 by Xeplosion · 0 comments
Owner

What happened?

rollback.yml rolls back by running git checkout HEAD~1 on the server. This works for repos where the deployed files are a git working directory, but breaks for PHP repos using the symlink-based release strategy — the deployed code lives in a versioned releases/ directory, not a git repo, and current is just a symlink pointing at it.

Steps to reproduce

  1. Deploy a PHP repo using template-php
  2. Trigger rollback.yml either manually or via a failed healthcheck
  3. The rollback step will fail or silently do nothing useful since /var/www/<site>/releases/ is not a git repo

Expected behavior

Rollback flips the current symlink to the previous release directory and reloads php-fpm and nginx, matching the same atomic deploy strategy used by service-start.sh.

Environment

Any repo using template-php with symlink-based deployment

Additional context

Two possible solutions — either add a scripts/rollback.sh stub that rollback.yml calls (consistent with the existing script delegation pattern), or add a deploy.strategy field to xegames.config.yml (git or symlink) and have rollback.yml branch on that value. The scripts/rollback.sh approach is preferred as it keeps workflow logic minimal and puts implementation detail in the script where it belongs. Both rollback.yml in .forgejo and template-php need updating.

Checklist

  • I have searched for existing issues before opening this one
  • I can reliably reproduce this
  • I have included enough detail to investigate
### What happened? `rollback.yml` rolls back by running `git checkout HEAD~1` on the server. This works for repos where the deployed files are a git working directory, but breaks for PHP repos using the symlink-based release strategy — the deployed code lives in a versioned `releases/` directory, not a git repo, and `current` is just a symlink pointing at it. ### Steps to reproduce 1. Deploy a PHP repo using `template-php` 2. Trigger `rollback.yml` either manually or via a failed healthcheck 3. The rollback step will fail or silently do nothing useful since `/var/www/<site>/releases/` is not a git repo ### Expected behavior Rollback flips the `current` symlink to the previous release directory and reloads php-fpm and nginx, matching the same atomic deploy strategy used by `service-start.sh`. ### Environment Any repo using `template-php` with symlink-based deployment ### Additional context Two possible solutions — either add a `scripts/rollback.sh` stub that `rollback.yml` calls (consistent with the existing script delegation pattern), or add a `deploy.strategy` field to `xegames.config.yml` (`git` or `symlink`) and have `rollback.yml` branch on that value. The `scripts/rollback.sh` approach is preferred as it keeps workflow logic minimal and puts implementation detail in the script where it belongs. Both `rollback.yml` in `.forgejo` and `template-php` need updating. ### Checklist - [x] I have searched for existing issues before opening this one - [x] I can reliably reproduce this - [x] I have included enough detail to investigate
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
XeplosionGames/.forgejo#5
No description provided.