@biffo/cli 0.211.3 → 0.211.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +18 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4984,6 +4984,7 @@ function formatWiringResult(environment, result) {
|
|
|
4984
4984
|
// src/commands/deploy.ts
|
|
4985
4985
|
var deployCommand = new Command9("deploy").description("Deploy infrastructure and application to an environment").argument("<environment>", "Target environment: dev | staging | prod").option("--infra-only", "Deploy infrastructure only, skip application build").option("--app-only", "Deploy application only, skip Terraform").option("-p, --project <name>", "Project name (overrides biffo.config.json in current directory)").option("-c, --config <path>", "Path to biffo.config.json").option("-y, --yes", "Skip deployment target confirmation").action(
|
|
4986
4986
|
async (environment, options) => {
|
|
4987
|
+
process.exitCode = 1;
|
|
4987
4988
|
const validEnvs = ["dev", "staging", "prod"];
|
|
4988
4989
|
if (!validEnvs.includes(environment)) {
|
|
4989
4990
|
log.error(`Unknown environment: ${environment}. Must be one of: ${validEnvs.join(", ")}`);
|
|
@@ -4995,12 +4996,14 @@ var deployCommand = new Command9("deploy").description("Deploy infrastructure an
|
|
|
4995
4996
|
`));
|
|
4996
4997
|
if (!options.yes && !await confirmDeployTarget(config, environment)) {
|
|
4997
4998
|
log.warn("Deploy cancelled");
|
|
4999
|
+
process.exitCode = 0;
|
|
4998
5000
|
return;
|
|
4999
5001
|
}
|
|
5000
5002
|
const token = resolveGithubToken();
|
|
5001
5003
|
const github = new GitHubAdapter(token);
|
|
5002
5004
|
const aws = new AwsAdapter(config);
|
|
5003
5005
|
await runDeploy(github, aws, config, environment, { ...options, token });
|
|
5006
|
+
process.exitCode = 0;
|
|
5004
5007
|
}
|
|
5005
5008
|
);
|
|
5006
5009
|
async function resolveConfig2(options) {
|
|
@@ -5062,17 +5065,28 @@ function describeProject(config) {
|
|
|
5062
5065
|
const { org, repo } = config.source_control.config;
|
|
5063
5066
|
return `${config.project.name} (${org}/${repo})`;
|
|
5064
5067
|
}
|
|
5065
|
-
async function chooseProject(projects) {
|
|
5068
|
+
async function chooseProject(projects, isTTY = Boolean(process.stdin.isTTY)) {
|
|
5069
|
+
const question = "Which project do you want to deploy?";
|
|
5070
|
+
const remedy = "Pass --project <name> to choose one. Available:\n" + projects.map((p) => ` ${describeProject(p)}`).join("\n");
|
|
5071
|
+
if (isNonInteractive()) {
|
|
5072
|
+
throw new NonInteractiveError(nonInteractiveMessage(question, remedy));
|
|
5073
|
+
}
|
|
5074
|
+
if (!isTTY) {
|
|
5075
|
+
throw new NonInteractiveError(
|
|
5076
|
+
`Refusing to prompt for "${question}" \u2014 no interactive terminal is attached.
|
|
5077
|
+
${remedy}`
|
|
5078
|
+
);
|
|
5079
|
+
}
|
|
5066
5080
|
const { chosen } = await promptOr(
|
|
5067
5081
|
{
|
|
5068
|
-
question
|
|
5069
|
-
remedy
|
|
5082
|
+
question,
|
|
5083
|
+
remedy
|
|
5070
5084
|
},
|
|
5071
5085
|
[
|
|
5072
5086
|
{
|
|
5073
5087
|
type: "list",
|
|
5074
5088
|
name: "chosen",
|
|
5075
|
-
message:
|
|
5089
|
+
message: question,
|
|
5076
5090
|
choices: projects.map((p) => ({ name: describeProject(p), value: p.project.name }))
|
|
5077
5091
|
}
|
|
5078
5092
|
]
|