diff --git a/docs/help.md b/docs/help.md index fa4bbec..5887e1d 100644 --- a/docs/help.md +++ b/docs/help.md @@ -134,7 +134,7 @@ Deployment and test server management - **create** (alias: `c`) - Create new testserver on AWS - **delete** (alias: `d`) - Choose a testserver to delete - **grab** (alias: `g`) - Auto-pick a free testserver and update it with your current branch - - Picks the "most free" server using this priority: branch is `master` → issue closed → last commit >1 month → no linked issue. Excludes named servers (`-ingrid`, `-usa`) and failed/in-progress stacks. + - Picks the "most free" server using this priority: branch is `master` → issue closed → last commit >1 month → no linked issue. Only uses servers with numbers (ex: `-3`, `-12`) and excludes failed/in-progress stacks. - If your branch is already deployed on a server, exits early with the URL. - If no free servers are found, prints the full status table. - Flags: diff --git a/src/commands/deployment/testservers/grab/grab.ts b/src/commands/deployment/testservers/grab/grab.ts index 016546c..e16849c 100644 --- a/src/commands/deployment/testservers/grab/grab.ts +++ b/src/commands/deployment/testservers/grab/grab.ts @@ -13,7 +13,7 @@ import { getTestStacksInfo, Stack } from '../../../../common/testservers'; import { getIssueFromRepo } from '../../../../services/github_rest'; const { spawn } = require('child_process'); -const EXCLUDED_NAMED_STACKS = ['photowall-test-ingrid', 'photowall-test-usa']; +const TEST_STACK_NAME_PATTERN = /^photowall-test-\d+$/; const EXCLUDED_STATUSES = [ 'UPDATE_FAILED', 'CREATE_FAILED', @@ -148,7 +148,7 @@ module.exports = { const now = Date.now(); const candidates: Candidate[] = []; for (const stack of testStacks) { - if (EXCLUDED_NAMED_STACKS.includes(stack.name)) continue; + if (!TEST_STACK_NAME_PATTERN.test(stack.name)) continue; if (EXCLUDED_STATUSES.includes(stack.status)) continue; const updatedTs = new Date(stack.updated).getTime();