From d03266ea547473f5a00997ba5d6350c47535e774 Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Wed, 15 Feb 2023 13:22:32 -0600 Subject: [PATCH 1/8] Add plugin subcommands to spec Signed-off-by: Josh Duffney --- specs/commandline/plugin.md | 46 ++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/specs/commandline/plugin.md b/specs/commandline/plugin.md index 5e17f62ae..88fd149c0 100644 --- a/specs/commandline/plugin.md +++ b/specs/commandline/plugin.md @@ -36,15 +36,55 @@ Aliases: list, ls ``` +### notation plugin install + +```text +Installs a plugin + +Usage: + notation plugin install --name --plugin-package [flags] + +Flags: + -n, --name string name of the plugin + -p, --plugin-package string path to the plugin package + -h, --help help for install + +Aliases: + install, add +``` + +### notation plugin remove + +```text +Removes a plugin + +Usage: + notation plugin remove [flags] + +Flags: + -h, --help help for remove + +Aliases: + remove, rm +``` + ## Usage ### Install a plugin -Currently there is no subcommand available for plugin installation. Plugin publisher should provide instructions to download and install the plugin. +```shell +notation plugin install --name --plugin-package +``` + +Unpon successful execution, the plugins directory is created under the default plugin directory if it does not exist, and the plugin package is extracted to the plugins directory. The plugin installation is then verified. If the verification fails, the plugin is removed from the plugins directory and an error is returned. ### Uninstall a plugin -Currently there is no subcommand available for plugin un-installation. Plugin publisher should provide instructions to uninstall the plugin. +```shell +notation plugin remove +``` + +Upon successful execution, the plugin is removed from the plugins directory. If the plugin is not found, an error is returned showing the syntax for the plugin list command to show the installed plugins. ### List installed plugins @@ -58,5 +98,5 @@ An example of output from `notation plugin list`: ```text NAME DESCRIPTION VERSION CAPABILITIES ERROR -azure-kv Sign artifacts with keys in Azure Key Vault v0.3.1-alpha.1 [SIGNATURE_GENERATOR.RAW] +azure-kv Sign artifacts with keys in Azure Key Vault v0.5.0-rc.1 [SIGNATURE_GENERATOR.RAW] ``` From 81e5cc7e1b4cecbb95197a945a8570e54aa925fe Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Thu, 16 Feb 2023 12:15:37 -0600 Subject: [PATCH 2/8] Update specs/commandline/plugin.md Co-authored-by: Shiwei Zhang Signed-off-by: GitHub --- specs/commandline/plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/commandline/plugin.md b/specs/commandline/plugin.md index 88fd149c0..e45f3b9a2 100644 --- a/specs/commandline/plugin.md +++ b/specs/commandline/plugin.md @@ -59,7 +59,7 @@ Aliases: Removes a plugin Usage: - notation plugin remove [flags] + notation plugin remove [flags] Flags: -h, --help help for remove From 057806d73998a47da27547557b9f0fe44ca22534 Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Thu, 16 Feb 2023 12:17:07 -0600 Subject: [PATCH 3/8] Update specs/commandline/plugin.md Co-authored-by: Shiwei Zhang Signed-off-by: GitHub --- specs/commandline/plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/commandline/plugin.md b/specs/commandline/plugin.md index e45f3b9a2..335ecf343 100644 --- a/specs/commandline/plugin.md +++ b/specs/commandline/plugin.md @@ -42,7 +42,7 @@ Aliases: Installs a plugin Usage: - notation plugin install --name --plugin-package [flags] + notation plugin install [--name ] [flags] Flags: -n, --name string name of the plugin From 613522e1332a9c87674d8cac3d2a62282d2c384d Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Thu, 16 Feb 2023 12:20:07 -0600 Subject: [PATCH 4/8] Add uninstall and delete as aliases Signed-off-by: GitHub --- specs/commandline/plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/commandline/plugin.md b/specs/commandline/plugin.md index 335ecf343..74ff30b05 100644 --- a/specs/commandline/plugin.md +++ b/specs/commandline/plugin.md @@ -65,7 +65,7 @@ Flags: -h, --help help for remove Aliases: - remove, rm + remove, rm, uninstall, delete ``` ## Usage From 626442c3913e3c6b5990d526fab677812704c222 Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Tue, 7 Mar 2023 09:53:11 -0600 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: Shiwei Zhang Signed-off-by: GitHub --- specs/commandline/plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/commandline/plugin.md b/specs/commandline/plugin.md index 74ff30b05..13be11ad6 100644 --- a/specs/commandline/plugin.md +++ b/specs/commandline/plugin.md @@ -45,7 +45,7 @@ Usage: notation plugin install [--name ] [flags] Flags: - -n, --name string name of the plugin + -n, --name string name of the plugin -p, --plugin-package string path to the plugin package -h, --help help for install From 42f18192ef896fbe52aab6bd2d854722dafd7a70 Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Wed, 22 Mar 2023 15:35:55 -0500 Subject: [PATCH 6/8] Remove --name from plugin install subcommand Signed-off-by: Josh Duffney --- specs/commandline/plugin.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specs/commandline/plugin.md b/specs/commandline/plugin.md index 13be11ad6..3f444a270 100644 --- a/specs/commandline/plugin.md +++ b/specs/commandline/plugin.md @@ -16,6 +16,8 @@ Usage: Available Commands: list List installed plugins + install Installs a plugin + remove Removes a plugin Flags: -h, --help help for plugin @@ -42,11 +44,9 @@ Aliases: Installs a plugin Usage: - notation plugin install [--name ] [flags] + notation plugin install [flags] Flags: - -n, --name string name of the plugin - -p, --plugin-package string path to the plugin package -h, --help help for install Aliases: @@ -73,10 +73,10 @@ Aliases: ### Install a plugin ```shell -notation plugin install --name --plugin-package +notation plugin install ``` -Unpon successful execution, the plugins directory is created under the default plugin directory if it does not exist, and the plugin package is extracted to the plugins directory. The plugin installation is then verified. If the verification fails, the plugin is removed from the plugins directory and an error is returned. +Upon successful execution, the plugin is moved to plugins directory. If the plugin directory does not exist, it will be created. The plugin installation is then verified and if the verification fails, the plugin is removed from the plugins directory and an error is returned. When an existing plugin is detected, the versions are compared and if the existing plugin is a lower version then it is replaced by the newer version. ### Uninstall a plugin From ab4b1189a3d273635c6cf2a02c13b1aba6ccb9f2 Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Thu, 23 Mar 2023 14:23:55 -0500 Subject: [PATCH 7/8] Add: --force flag and revisted install description Signed-off-by: Josh Duffney --- specs/commandline/plugin.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specs/commandline/plugin.md b/specs/commandline/plugin.md index 3f444a270..43f5845bb 100644 --- a/specs/commandline/plugin.md +++ b/specs/commandline/plugin.md @@ -48,6 +48,7 @@ Usage: Flags: -h, --help help for install + -f, --force force the installation of a plugin Aliases: install, add @@ -76,7 +77,7 @@ Aliases: notation plugin install ``` -Upon successful execution, the plugin is moved to plugins directory. If the plugin directory does not exist, it will be created. The plugin installation is then verified and if the verification fails, the plugin is removed from the plugins directory and an error is returned. When an existing plugin is detected, the versions are compared and if the existing plugin is a lower version then it is replaced by the newer version. +Upon successful execution, the plugin is moved to plugins directory and name+version of plugin is displayed. If the plugin directory does not exist, it will be created. When an existing plugin is detected, the versions are compared and if the existing plugin is a lower version then it is replaced by the newer version. ### Uninstall a plugin From 378e92c656d4dafdf2842154d3766d4971412bd3 Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Tue, 28 Mar 2023 13:33:36 +0000 Subject: [PATCH 8/8] changed moved to copied Signed-off-by: GitHub --- specs/commandline/plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/commandline/plugin.md b/specs/commandline/plugin.md index 43f5845bb..58aeddd4e 100644 --- a/specs/commandline/plugin.md +++ b/specs/commandline/plugin.md @@ -77,7 +77,7 @@ Aliases: notation plugin install ``` -Upon successful execution, the plugin is moved to plugins directory and name+version of plugin is displayed. If the plugin directory does not exist, it will be created. When an existing plugin is detected, the versions are compared and if the existing plugin is a lower version then it is replaced by the newer version. +Upon successful execution, the plugin is copied to plugins directory and name+version of plugin is displayed. If the plugin directory does not exist, it will be created. When an existing plugin is detected, the versions are compared and if the existing plugin is a lower version then it is replaced by the newer version. ### Uninstall a plugin