Skip to content

Commit

Permalink
Allow to skip webhooks update when using env create with `restore-f…
Browse files Browse the repository at this point in the history
…rom` option
  • Loading branch information
2can authored and zaiste committed Oct 26, 2023
1 parent 6119e79 commit 1b4bf1e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 26 deletions.
27 changes: 14 additions & 13 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,19 +592,20 @@ Positionals:
name name for the new environment [string]
Options:
--json Output the data as JSON [boolean] [default: false]
--short Output data as text [boolean] [default: false]
-u, --instance, --url Saleor instance API URL (must start with the protocol, i.e. https:// or http://) [string]
--project create this environment in this project [string]
--database specify how to populate the database [string]
--saleor specify the Saleor version [string]
--domain specify the domain for the environment [string]
--login specify the API Basic Auth login [string]
--pass specify the API Basic Auth password [string]
--restore-from specify snapshot id to restore the database from [string]
--skip-restrict skip Basic Auth restriction prompt [boolean]
-V, --version Show version number [boolean]
-h, --help Show help [boolean]
--json Output the data as JSON [boolean] [default: false]
--short Output data as text [boolean] [default: false]
-u, --instance, --url Saleor instance API URL (must start with the protocol, i.e. https:// or http://) [string]
--project create this environment in this project [string]
--database specify how to populate the database [string]
--saleor specify the Saleor version [string]
--domain specify the domain for the environment [string]
--login specify the API Basic Auth login [string]
--pass specify the API Basic Auth password [string]
--restore-from specify snapshot id to restore the database from [string]
--skip-webhooks-update use with `restore-from` option, skip webhooks update prompt when restoring from snapshot [boolean]
--skip-restrict skip Basic Auth restriction prompt [boolean]
-V, --version Show version number [boolean]
-h, --help Show help [boolean]
Examples:
saleor env create my-environment
Expand Down
27 changes: 14 additions & 13 deletions docs/cli/commands/environment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,20 @@ Positionals:
name name for the new environment [string]
Options:
--json Output the data as JSON [boolean] [default: false]
--short Output data as text [boolean] [default: false]
-u, --instance, --url Saleor instance API URL (must start with the protocol, i.e. https:// or http://) [string]
--project create this environment in this project [string]
--database specify how to populate the database [string]
--saleor specify the Saleor version [string]
--domain specify the domain for the environment [string]
--login specify the API Basic Auth login [string]
--pass specify the API Basic Auth password [string]
--restore-from specify snapshot id to restore the database from [string]
--skip-restrict skip Basic Auth restriction prompt [boolean]
-V, --version Show version number [boolean]
-h, --help Show help [boolean]
--json Output the data as JSON [boolean] [default: false]
--short Output data as text [boolean] [default: false]
-u, --instance, --url Saleor instance API URL (must start with the protocol, i.e. https:// or http://) [string]
--project create this environment in this project [string]
--database specify how to populate the database [string]
--saleor specify the Saleor version [string]
--domain specify the domain for the environment [string]
--login specify the API Basic Auth login [string]
--pass specify the API Basic Auth password [string]
--restore-from specify snapshot id to restore the database from [string]
--skip-webhooks-update use with `restore-from` option, skip webhooks update prompt when restoring from snapshot [boolean]
--skip-restrict skip Basic Auth restriction prompt [boolean]
-V, --version Show version number [boolean]
-h, --help Show help [boolean]
Examples:
saleor env create my-environment
Expand Down
7 changes: 7 additions & 0 deletions src/cli/env/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface CommandOptions extends Options {
pass?: string;
restore: boolean;
restoreFrom: string;
skipWebhooksUpdate: boolean;
skipRestrict: boolean;
}

Expand Down Expand Up @@ -72,6 +73,11 @@ export const builder: CommandBuilder = (_) =>
type: 'string',
desc: 'specify snapshot id to restore the database from',
})
.option('skip-webhooks-update', {
type: 'boolean',
demandOption: false,
desc: 'use with `restore-from` option, skip webhooks update prompt when restoring from snapshot',
})
.option('skip-restrict', {
type: 'boolean',
desc: 'skip Basic Auth restriction prompt',
Expand All @@ -96,6 +102,7 @@ export const handler = async (argv: Arguments<CommandOptions>) => {
const { update } = await Enquirer.prompt<{ update: string }>({
type: 'confirm',
name: 'update',
skip: !!argv.skipWebhooksUpdate,
message: 'Would you like to update webhooks targetUrl',
});

Expand Down

0 comments on commit 1b4bf1e

Please sign in to comment.