# Plain PHP release fixture

This repository is the smallest manual fixture for the Kloudster Git release flow. It has no dependencies and requires no build command. Use it to verify repository access, source checkout, validation, publication, activation, and the HTTP health check.

## Requirements

- PHP 8.4.
- Git.
- Access to the private fixture repository on `gitlab.tucha.ua`.
- A Kloudster site configured for Git code management with a code storage attached.

## Run locally

```bash
php scripts/validate.php
php -S 127.0.0.1:8080
```

In another terminal:

```bash
curl http://127.0.0.1:8080/
curl http://127.0.0.1:8080/health.php
```

The health request must return HTTP 200 and JSON containing `"status":"ok"`.

## Clone the fixture repository

```bash
git clone https://gitlab.tucha.ua/kloudster-development/release-fixture-plain-php.git
cd release-fixture-plain-php
```

Configure a GitLab source credential in Kloudster because this repository is private.

## Kloudster release configuration

Use these values in the site's release configuration:

- Repository URL: `https://gitlab.tucha.ua/kloudster-development/release-fixture-plain-php.git`.
- Branch: `main`.
- Build preset: `As is`.
- Build commands: leave empty.
- Validation command: `php scripts/validate.php`.
- Health check path: `/health.php`.

Use PHP 8.4 for this fixture. It is verified against the Kloudster runtime image `evgeniykhrebtov/php8.4-apache-molybdenum:test-1`.

## Verify an update

Change `version` in `release.php`, then commit and push it:

```bash
git add release.php
git commit -m "Release plain-v2"
git push
```

Start a new release in Kloudster. After it succeeds, the home page and health response must both show the new version. The previous release should remain available as the rollback target until retention removes it.

## Intentional validation failure

Temporarily set `version` in `release.php` to an empty string, commit, push, and start another release. The validation command must fail before activation, and the previously active version must keep serving traffic. Restore a non-empty version in a new commit before continuing.
