Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webiny CLI - webiny refresh Command #4552

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion packages/cli-plugin-deploy-pulumi/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,44 @@ export const commands: CliCommandPlugin[] = [
}
);

yargs.command(
"refresh <folder>",
`Refreshes Pulumi state for given project application and environment`,
yargs => {
yargs.example("$0 refresh api --env=dev --json", "");
yargs.positional("folder", {
describe: `Project application folder`,
type: "string"
});
yargs
.option("region", {
describe: `Region to target`,
type: "string",
required: false
})
.check(validateRegion);
yargs.option("env", {
required: true,
describe: `Environment`,
type: "string"
});
yargs.option("variant", {
describe: `Variant`,
type: "string",
required: false
});
yargs.option("debug", {
default: false,
describe: `Turn on debug logs`,
type: "boolean"
});
},
async argv => {
const { refreshCommand } = require("./refresh");
return refreshCommand(argv, context);
}
);

yargs.command(
"pulumi <folder>",
`Runs a Pulumi command in the provided project application folder. Note: make sure to use "--" before the actual Pulumi command.`,
Expand Down Expand Up @@ -531,7 +569,7 @@ export const commands: CliCommandPlugin[] = [

yargs.command(
"execute-migrations [pattern]",
`Execute data migrations Lambda. If pattern is provided, only the matching migrations will be executed.`,
`Execute data migrations Lambda. If pattern is provided, only the matching migrations will be executed`,
() => {
yargs.example("$0 execute-migrations --env dev", "");
yargs.example("$0 execute-migrations 5.35.0-001 --env dev", "");
Expand Down
10 changes: 10 additions & 0 deletions packages/cli-plugin-deploy-pulumi/src/commands/refresh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { createPulumiCommand } from "~/utils";
import { pulumiRunCommand } from "./pulumiRun";

export const refreshCommand = createPulumiCommand({
name: "refresh",
createProjectApplicationWorkspace: false,
command: async ({ inputs, context }) => {
return pulumiRunCommand({ ...inputs, _: ["", "refresh", "--yes"] }, context);
}
});
Loading