feat: CISandbox v1.0.0 — Interactive CI Pipeline Debugger with Local Env Sync
This commit is contained in:
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env node
|
||||
import { Command } from 'commander';
|
||||
import chalk from 'chalk';
|
||||
import { parseWorkflow, pickJob } from './parser.js';
|
||||
import { runInteractive } from './runner.js';
|
||||
const program = new Command();
|
||||
program
|
||||
.name('cisandbox')
|
||||
.description('Interactive CI Pipeline Debugger with Local Env Sync')
|
||||
.version('1.0.0');
|
||||
program
|
||||
.argument('<workflow-file>', 'Path to GitHub Actions workflow YAML')
|
||||
.option('-j, --job <name>', 'Job name to run (required if multiple jobs)')
|
||||
.option('-w, --workspace <path>', 'Workspace directory to mount', process.cwd())
|
||||
.option('-e, --env-file <path>', '.env file to load into container')
|
||||
.option('-n, --dry-run', 'Preview steps without running containers')
|
||||
.action(async (workflowFile, options) => {
|
||||
try {
|
||||
const workflow = parseWorkflow(workflowFile);
|
||||
const { name: jobName, job } = pickJob(workflow, options.job);
|
||||
const ctx = {
|
||||
workflow,
|
||||
jobName,
|
||||
job,
|
||||
stepResults: [],
|
||||
containerId: null,
|
||||
env: {},
|
||||
};
|
||||
await runInteractive(ctx, {
|
||||
workflowFile,
|
||||
jobName,
|
||||
dryRun: options.dryRun,
|
||||
workspace: options.workspace,
|
||||
envFile: options.envFile,
|
||||
});
|
||||
const failed = ctx.stepResults.filter(r => r.status === 'failure').length;
|
||||
process.exit(failed > 0 ? 1 : 0);
|
||||
}
|
||||
catch (err) {
|
||||
console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
program.parse();
|
||||
//# sourceMappingURL=cli.js.map
|
||||
Reference in New Issue
Block a user