Skip to content

Commit

Permalink
Merge pull request #1270 from polywrap/feat/cli-manifest-command-temp
Browse files Browse the repository at this point in the history
Cli manifest command
  • Loading branch information
dOrgJelli authored Sep 25, 2022
2 parents eed6bdd + c20149a commit 04776dc
Show file tree
Hide file tree
Showing 59 changed files with 1,438 additions and 103 deletions.
27 changes: 19 additions & 8 deletions packages/cli/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
"commands_infra_description": "Modular Infrastructure-As-Code Orchestrator",
"commands_infra_actions_subtitle": "Infra allows you to execute the following commands:",
"commands_infra_options_options": "options",
"commands_infra_options_manifest": "manifest",
"commands_infra_options_i_node": "node",
"commands_infra_options_h": "Show usage information",
"commands_infra_options_m": "Use only specified modules",
"commands_infra_options_o": "Use only specified modules",
"commands_infra_options_o_module": "module",
"commands_infra_options_v": "Verbose output (default: false)",
"commands_infra_options_d": "Run in detached mode",
"commands_infra_moduleName": "module-name",
"commands_infra_manifestPath": "manifest-path",
"commands_infra_manifestPathDescription": "Infra Manifest path",
"commands_infra_options_m_path": "path",
"commands_infra_options_m": "Path to the Polywrap Infra manifest file (default: {default})",
"commands_infra_command_up": "Start Polywrap infrastructure",
"commands_infra_command_down": "Stop Polywrap infrastructure",
"commands_infra_command_vars": "Show Polywrap infrastructure's required .env variables",
Expand Down Expand Up @@ -126,11 +125,11 @@
"commands_run_options_validateScript": "Validate the output of the workflow jobs",
"commands_run_options_validate": "cue-file",
"commands_run_options_outputFile": "Output file path for the workflow result",
"commands_run_options_manifest": "manifest",
"commands_run_options_m_path": "path",
"commands_run_options_m": "Path to the Polywrap Workflow manifest file (default: {default})",
"commands_run_options_quiet": "Suppress output",
"commands_run_options_jobIds": "jobs",
"commands_run_options_jobs": "Specify ids of jobs that you want to run",
"commands_run_manifestPathDescription": "Workflow Manifest path",
"commands_run_error_validatorNotFound": "validate script not found at: {path}",
"commands_run_error_outputFileMissing": "{option} option missing {argument} argument",
"commands_run_error_clientConfigMissingPath": "{option} option missing {argument} argument",
Expand Down Expand Up @@ -162,12 +161,24 @@
"commands_run_error_missingScript": "Required argument {script} is missing",
"commands_run_error_noApi": "API needs to be initialized",
"commands_run_error_readFail": "Failed to read query {query}",
"commands_run_error_unsupportedOutputFileExt": "Unsupported outputFile extention: ${outputFileExt}",
"commands_run_error_unsupportedOutputFileExt": "Unsupported outputFile extention: {outputFileExt}",
"commands_run_error_cueDoesNotExist": "Require cue to run validator, checkout https://cuelang.org/ for more information",
"commands_run_error_noWorkflowScriptFound": "Workflow script not found at path: {path}",
"commands_run_error_noTestEnvFound": "polywrap test-env not found, please run 'polywrap infra up --modules=eth-ens-ipfs'",
"commands_polywrap_error_notACommand": "is not a command",
"commands_polywrap_helpPrompt": "Type {command} to view common commands",
"commands_manifest_description": "Inspect & Migrade Polywrap Manifests",
"commands_manifest_options_m": "Path to the manifest file (default: {default})",
"commands_manifest_options_t": "Type of manifest file to migrate (default: {default})",
"commands_manifest_options_m_path": "path",
"commands_manifest_options_t_type": "type",
"commands_manifest_command_s": "Prints out the schema for the current manifest format.",
"commands_manifest_command_m": "Migrates the polywrap project manifest to the latest version.",
"commands_manifest_command_s_option_r": "Output raw JSON Schema",
"commands_manifest_command_m_preserveManifestMessage": "Saved previous version of manifest to {preservedFilePath}",
"commands_manifest_command_m_migrateManifestMessage": "Migrating {manifestFile} to version {version}",
"commands_manifest_formatError": "Unsupported manifest format. Please make sure that you have the 'format' field present in {fileName} with one of the following values: {values}",
"commands_manifest_projectTypeError": "Unsupported project type.",
"lib_codeGenerator_genCodeError": "Failed to generate types",
"lib_codeGenerator_genCodeText": "Generate types",
"lib_codeGenerator_genCodeWarning": "Warnings while generating types",
Expand Down
29 changes: 20 additions & 9 deletions packages/cli/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
"commands_infra_description": "Modular Infrastructure-As-Code Orchestrator",
"commands_infra_actions_subtitle": "Infra allows you to execute the following commands:",
"commands_infra_options_options": "options",
"commands_infra_options_manifest": "manifest",
"commands_infra_options_i_node": "node",
"commands_infra_options_h": "Show usage information",
"commands_infra_options_m": "Use only specified modules",
"commands_infra_options_o": "Use only specified modules",
"commands_infra_options_o_module": "module",
"commands_infra_options_v": "Verbose output (default: false)",
"commands_infra_options_d": "Run in detached mode",
"commands_infra_moduleName": "module-name",
"commands_infra_manifestPath": "manifest-path",
"commands_infra_manifestPathDescription": "Infra Manifest path",
"commands_infra_options_m_path": "path",
"commands_infra_options_m": "Path to the Polywrap Infra manifest file (default: {default})",
"commands_infra_command_up": "Start Polywrap infrastructure",
"commands_infra_command_down": "Stop Polywrap infrastructure",
"commands_infra_command_vars": "Show Polywrap infrastructure's required .env variables",
Expand Down Expand Up @@ -126,11 +125,11 @@
"commands_run_options_validateScript": "Validate the output of the workflow jobs",
"commands_run_options_validate": "cue-file",
"commands_run_options_outputFile": "Output file path for the workflow result",
"commands_run_options_manifest": "manifest",
"commands_run_options_m_path": "path",
"commands_run_options_m": "Path to the Polywrap Workflow manifest file (default: {default})",
"commands_run_options_quiet": "Suppress output",
"commands_run_options_jobIds": "jobs",
"commands_run_options_jobs": "Specify ids of jobs that you want to run",
"commands_run_manifestPathDescription": "Workflow Manifest path",
"commands_run_error_validatorNotFound": "validate script not found at: {path}",
"commands_run_error_outputFileMissing": "{option} option missing {argument} argument",
"commands_run_error_clientConfigMissingPath": "{option} option missing {argument} argument",
Expand Down Expand Up @@ -162,12 +161,24 @@
"commands_run_error_missingScript": "Required argument {script} is missing",
"commands_run_error_noApi": "API needs to be initialized",
"commands_run_error_readFail": "Failed to read query {query}",
"commands_run_error_unsupportedOutputFileExt": "Unsupported outputFile extention: ${outputFileExt}",
"commands_run_error_unsupportedOutputFileExt": "Unsupported outputFile extention: {outputFileExt}",
"commands_run_error_cueDoesNotExist": "Require cue to run validator, checkout https://cuelang.org/ for more information",
"commands_run_error_noWorkflowScriptFound": "Workflow script not found at path: {path}",
"commands_run_error_noTestEnvFound": "polywrap test-env not found, please run 'polywrap infra up --modules=eth-ens-ipfs'",
"commands_polywrap_error_notACommand": "is not a command",
"commands_polywrap_helpPrompt": "Type {command} to view common commands",
"commands_manifest_description": "Inspect & Migrade Polywrap Manifests",
"commands_manifest_options_m": "Path to the manifest file (default: {default})",
"commands_manifest_options_t": "Type of manifest file to migrate (default: {default})",
"commands_manifest_options_m_path": "path",
"commands_manifest_options_t_type": "type",
"commands_manifest_command_s": "Prints out the schema for the current manifest format.",
"commands_manifest_command_m": "Migrates the polywrap project manifest to the latest version.",
"commands_manifest_command_s_option_r": "Output raw JSON Schema",
"commands_manifest_command_m_preserveManifestMessage": "Saved previous version of manifest to {preservedFilePath}",
"commands_manifest_command_m_migrateManifestMessage": "Migrating {manifestFile} to version {version}",
"commands_manifest_formatError": "Could not detect manifest format. Please make sure that you have the 'format' field present in {fileName} with one of the following values: {values}",
"commands_manifest_projectTypeError": "Unsupported project type.",
"lib_codeGenerator_genCodeError": "Failed to generate types",
"lib_codeGenerator_genCodeText": "Generate types",
"lib_codeGenerator_genCodeWarning": "Warnings while generating types",
Expand Down Expand Up @@ -216,8 +227,8 @@
"lib_helpers_manifest_outputWarning": "Warnings writing manifest to {path}",
"lib_helpers_manifest_unableToDump": "Unable to dump manifest: {manifest}",
"lib_helpers_manifest_unableToLoad": "Unable to load manifest: {path}",
"lib_helpers_docker_couldNotConnect": "Could not connect to the Docker daemon. Is the docker daemon running?",
"lib_helpers_docker_copyText": "Artifacts written to {path} from the image `{image}`",
"lib_helpers_docker_couldNotConnect": "Could not connect to the Docker daemon. Is the docker daemon running?",
"lib_helpers_docker_copyError": "Failed to write build artifacts to {path} from the image `{image}`",
"lib_helpers_docker_copyWarning": "Warnings write build artifacts to {path} from the image `{image}`",
"lib_helpers_docker_buildText": "Building source image `{image}` using dockerfile `{dockerfile}` in context `{context}`",
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"ipfs-http-client": "48.1.3",
"js-yaml": "3.14.0",
"jsonschema": "1.4.0",
"json-schema-ref-parser": "9.0.9",
"json-schema": "0.4.0",
"mustache": "4.0.1",
"ora": "4.0.0",
"os-locale": "5.0.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/src/__tests__/e2e/codegen.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ Generate Code For Polywrap Projects
Options:
-m, --manifest-file <path> Path to the Polywrap manifest file
(default: polywrap.yaml | polywrap.yml)
(default: polywrap.yaml | polywrap.yml |
polywrap.app.yaml | polywrap.app.yml |
polywrap.plugin.yaml |
polywrap.plugin.yml)
-g, --codegen-dir <path> Output directory for the generated code
(default: ./src/wrap)
-p, --publish-dir <path> Output path for the built schema and
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/__tests__/e2e/help.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Commands:
infra|i [options] <action> Modular Infrastructure-As-Code Orchestrator
run|r [options] Runs Workflows
docgen|o [options] <action> Generate wrapper documentation
manifest|m Inspect & Migrade Polywrap Manifests
help [command] display help for command
`;

Expand Down
18 changes: 10 additions & 8 deletions packages/cli/src/__tests__/e2e/infra.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const HELP = `Usage: polywrap infra|i <action> [options]
Modular Infrastructure-As-Code Orchestrator
Arguments:
action
action
Infra allows you to execute the following commands:
up Start Polywrap infrastructure
down Stop Polywrap infrastructure
Expand All @@ -28,10 +28,12 @@ Arguments:
(choices: "up", "down", "vars", "config")
Options:
--manifest <manifest> Infra Manifest path (default: "polywrap.infra.yaml")
-m, --modules <module-name,module-name> Use only specified modules
-v, --verbose Verbose output (default: false)
-h, --help display help for command
-m, --manifest-file <path> Path to the Polywrap Infra manifest file
(default: polywrap.infra.yaml |
polywrap.infra.yml)
-o, --modules <module,module> Use only specified modules
-v, --verbose Verbose output (default: false)
-h, --help display help for command
`;

const portInUse = (port: number) => {
Expand Down Expand Up @@ -177,7 +179,7 @@ describe("e2e tests for infra command", () => {

it("Should set environment up with all modules if no --modules are passed", async () => {
await runPolywrapCli(
["infra", "down", "--manifest=./polywrap.infra.yaml"],
["infra", "down", "--manifest-file=./polywrap.infra.yaml"],
getTestCaseDir(0),
);

Expand All @@ -188,7 +190,7 @@ describe("e2e tests for infra command", () => {
]);

await runPolywrapCli(
["infra", "up", "--manifest=./polywrap.infra.yaml"],
["infra", "up", "--manifest-file=./polywrap.infra.yaml"],
getTestCaseDir(0),
);

Expand Down Expand Up @@ -234,7 +236,7 @@ describe("e2e tests for infra command", () => {

it("Should throw because default module declared in manifest is not recognized", async () => {
const { stderr } = await runPolywrapCli(
["infra", "up", "--manifest=./polywrap.infra.wrong.yaml"],
["infra", "up", "--manifest-file=./polywrap.infra.wrong.yaml"],
getTestCaseDir(4),
);

Expand Down
Loading

0 comments on commit 04776dc

Please sign in to comment.