-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.mjs
27 lines (23 loc) · 1.22 KB
/
index.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env node
import { Command } from "commander";
import { readFile } from "fs/promises";
import { start } from "./src/bblocal.mjs";
let version = JSON.parse(
await readFile(
new URL("./package.json", import.meta.url)
)
).version;
let program = new Command();
program
.version(version)
.description("An application for running bitbucket pipeline files locally. This tool is intended to help debug and create pipeline files.")
.option("-f, --file <file>", "bitbucket pipeline file", "bitbucket-pipelines.yml")
.option("-p, --pipeline <pipeline>", "Specify which pipeline to execute", "default")
.option("-s, --source <source folder>", "Specify the source folder", ".")
.option("-a, --artifacts <target artifact tar>", "Location of artifacts tar file", "./.bblocal/artifacts.tar")
.option("-c, --cache <cache folder>", "Folder to store cache for this build", "./.bblocal/cache")
.option("-k, --keys <.ssh folder>", "Mount your local ssh folder. !!WARNING!! only do this with trusted docker images.")
.option("-e, --env <items>", "comma separated list of variables. (eg \"VAR1=val1,VAR2=val2\")", (v) => v.split(","), []);
program.parse();
const options = program.opts();
start(options);