Point the stage checkout at Gitea and keep its host ports off prod Reverb.
CI / test (push) Successful in 34s
CI / build-and-push (push) Successful in 6s
CI / deploy-stage (push) Skipped
CI / deploy (push) Successful in 12s

Cloning from the prod directory made SHA fetches fail, and APP_HOST_PORT 18180 collided with production Reverb.
This commit is contained in:
ben
2026-08-13 18:40:06 +02:00
parent 3601ce8b6f
commit 1898be4def
4 changed files with 42 additions and 11 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace Tests\Unit;
use PHPUnit\Framework\TestCase;
class SetupStageScriptTest extends TestCase
{
public function test_clones_from_gitea_and_retargets_origin(): void
{
$script = file_get_contents(dirname(__DIR__, 2).'/scripts/setup-stage.sh');
$this->assertIsString($script);
$this->assertStringContainsString('git clone "${GITEA_REPO_URL}" "${STAGE_PATH}"', $script);
$this->assertStringContainsString('git remote set-url origin "${GITEA_REPO_URL}"', $script);
$this->assertStringNotContainsString('git clone "${PROD_PATH}"', $script);
$this->assertStringContainsString('APP_HOST_PORT" "18280"', $script);
$this->assertStringNotContainsString('APP_HOST_PORT" "18180"', $script);
}
public function test_deploy_fetches_advertised_refs_before_sha(): void
{
$script = file_get_contents(dirname(__DIR__, 2).'/scripts/deploy-production.sh');
$this->assertIsString($script);
$this->assertStringContainsString("git fetch --force origin '+refs/heads/*:refs/remotes/origin/*'", $script);
$this->assertStringContainsString('git checkout --force --detach "${DEPLOY_SHA}"', $script);
}
}