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
|
- **create** (alias: `c`) - Create new testserver on AWS
|
||||||
- **delete** (alias: `d`) - Choose a testserver to delete
|
- **delete** (alias: `d`) - Choose a testserver to delete
|
||||||
- **grab** (alias: `g`) - Auto-pick a free testserver and update it with your current branch
|
- **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 your branch is already deployed on a server, exits early with the URL.
|
||||||
- If no free servers are found, prints the full status table.
|
- If no free servers are found, prints the full status table.
|
||||||
- Flags:
|
- Flags:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { getTestStacksInfo, Stack } from '../../../../common/testservers';
|
|||||||
import { getIssueFromRepo } from '../../../../services/github_rest';
|
import { getIssueFromRepo } from '../../../../services/github_rest';
|
||||||
const { spawn } = require('child_process');
|
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 = [
|
const EXCLUDED_STATUSES = [
|
||||||
'UPDATE_FAILED',
|
'UPDATE_FAILED',
|
||||||
'CREATE_FAILED',
|
'CREATE_FAILED',
|
||||||
@@ -148,7 +148,7 @@ module.exports = {
|
|||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const candidates: Candidate[] = [];
|
const candidates: Candidate[] = [];
|
||||||
for (const stack of testStacks) {
|
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;
|
if (EXCLUDED_STATUSES.includes(stack.status)) continue;
|
||||||
|
|
||||||
const updatedTs = new Date(stack.updated).getTime();
|
const updatedTs = new Date(stack.updated).getTime();
|
||||||
|
|||||||
Reference in New Issue
Block a user