Refine grab command to only use numbered test servers and update help documentation
This commit is contained in:
+1
-1
@@ -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:
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user