From d9b27c1a1c0f15a4ea673b554421ae723c48c88f Mon Sep 17 00:00:00 2001 From: Guy Delarea Date: Thu, 18 Apr 2024 22:09:01 +0300 Subject: [PATCH 1/3] Update mv and cp commands target path description with the --flat flag and adding examples --- .../generic-files.md | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md b/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md index ef81d76..8d73c56 100644 --- a/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md +++ b/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md @@ -216,7 +216,7 @@ This command is used to copy files in Artifactory | Abbreviation | rt cp | | Command arguments |

The command takes two arguments source path and target path.

In case the --spec option is used, the commands accept no arguments.

| | Source path | Specifies the source path in Artifactory, from which the artifacts should be copied, in the following format: `[repository name]/[repository path].` You can use wildcards to specify multiple artifacts. | -| Target path |

Specifies the target path in Artifactory, to which the artifacts should be copied, in the following format: [repository name]/[repository path]

If the pattern ends with a slash, the target path is assumed to be a folder. For example, if you specify the target as "repo-name/a/b/", then "b" is assumed to be a folder in Artifactory into which files should be copied. If there is no terminal slash, the target path is assumed to be a file to which the copied file should be renamed. For example, if you specify the target as "repo-name/a/b", the copied file is renamed to "b" in Artifactory.

For flexibility in specifying the target path, you can include placeholders in the form of {1}, {2} which are replaced by corresponding tokens in the source path that are enclosed in parenthesis. For more details, please refer to Using Placeholders.

| +| Target path |

Specifies the target path in Artifactory, to which the artifacts should be copied, in the following format: [repository name]/[repository path]

By default the Target Path maintains the source path hierarchy, see --flat flag for more info. If the pattern ends with a slash, the target path is assumed to be a folder. For example, if you specify the target as "repo-name/a/b/", then "b" is assumed to be a folder in Artifactory into which files should be copied. If there is no terminal slash, the target path is assumed to be a file to which the copied file should be renamed. For example, if you specify the target as "repo-name/a/b", the copied file is renamed to "b" in Artifactory.

For flexibility in specifying the target path, you can include placeholders in the form of {1}, {2} which are replaced by corresponding tokens in the source path that are enclosed in parenthesis. For more details, please refer to Using Placeholders.

| | Command options |

When using the * or ; characters in the copy command options or arguments, make sure to wrap the whole options or arguments string in quotes (") to make sure the * or ; characters are not interpreted as literals.

| | --server-id |

[Optional]
Server ID configured using the config command. If not specified, the default configured Artifactory server is used.

| | --spec |

[Optional]
Path to a file spec. For more details, please refer to Using File Specs.

| @@ -264,6 +264,13 @@ Copy all artifacts located under **/rabbit** in the **source-frog-repo** reposit jf rt cp "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --props=Version=1.0 ``` +#### Example 4 + +Copy all artifacts located under /rabbit in the **source-frog-repo** repository to an absulote path. +``` +jf rt cp "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --flat +``` + ## Moving Files This command is used to move files in Artifactory @@ -281,7 +288,7 @@ This command is used to move files in Artifactory | Abbreviation | rt mv | | Command arguments |

The command takes two arguments source path and target path.

In case the --spec option is used, the commands accept no arguments.

| | Source path | Specifies the source path in Artifactory, from which the artifacts should be moved, in the following format: `[repository name]/[repository path].` You can use wildcards to specify multiple artifacts. | -| Target path |

Specifies the target path in Artifactory, to which the artifacts should be moved, in the following format: [repository name]/[repository path]

If the pattern ends with a slash, the target path is assumed to be a folder. For example, if you specify the target as "repo-name/a/b/", then "b" is assumed to be a folder in Artifactory into which files should be moved. If there is no terminal slash, the target path is assumed to be a file to which the moved file should be renamed. For example, if you specify the target as "repo-name/a/b", the moved file is renamed to "b" in Artifactory.

For flexibility in specifying the upload path, you can include placeholders in the form of {1}, {2} which are replaced by corresponding tokens in the source path that are enclosed in parenthesis. For more details, please refer to Using Placeholders.

| +| Target path |

Specifies the target path in Artifactory, to which the artifacts should be moved, in the following format: [repository name]/[repository path]

By default the Target Path maintains the source path hierarchy, see --flat flag for more info. If the pattern ends with a slash, the target path is assumed to be a folder. For example, if you specify the target as "repo-name/a/b/", then "b" is assumed to be a folder in Artifactory into which files should be moved. If there is no terminal slash, the target path is assumed to be a file to which the moved file should be renamed. For example, if you specify the target as "repo-name/a/b", the moved file is renamed to "b" in Artifactory.

For flexibility in specifying the upload path, you can include placeholders in the form of {1}, {2} which are replaced by corresponding tokens in the source path that are enclosed in parenthesis. For more details, please refer to Using Placeholders.

| | Command options |

When using the * or ; characters in the copy command options or arguments, make sure to wrap the whole options or arguments string in quotes (") to make sure the * or ; characters are not interpreted as literals.

| | --server-id |

[Optional]
Server ID configured using the config command. If not specified, the default configured Artifactory server is used.

| | --spec |

[Optional]
Path to a file spec. For more details, please refer to Using File Specs.

| @@ -329,6 +336,14 @@ Move all artifacts located under **/rabbit** in the **source-frog-repo** reposit jf rt mv "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --props=Version=1.0 ``` +#### Example 4 + +Move all artifacts located under /rabbit in the **source-frog-repo** repository to an absulote path. + +``` +jf rt cp "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --flat +``` + ## Deleting Files This command is used to delete files in Artifactory @@ -612,4 +627,4 @@ Remove the properties 'component', 'layer' and 'level' from files in the docker- ``` jf rt delp "docker-hub/*" "component,layer,level" -``` \ No newline at end of file +``` From 268468400f5c644d89b5126813692f904865224a Mon Sep 17 00:00:00 2001 From: Guy Delarea Date: Fri, 19 Apr 2024 07:53:57 +0300 Subject: [PATCH 2/3] Update and clarify example descriptions --- .../jfrog-cli/cli-for-jfrog-artifactory/generic-files.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md b/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md index 8d73c56..b36a784 100644 --- a/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md +++ b/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md @@ -266,7 +266,7 @@ jf rt cp "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --props=Version=1. #### Example 4 -Copy all artifacts located under /rabbit in the **source-frog-repo** repository to an absulote path. +Copy all artifacts located under /rabbit in the **source-frog-repo** repository into the same path in the target-frog-repo repository without maintaining the original subdirectory hierarchy. ``` jf rt cp "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --flat ``` @@ -338,10 +338,9 @@ jf rt mv "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --props=Version=1. #### Example 4 -Move all artifacts located under /rabbit in the **source-frog-repo** repository to an absulote path. - +Move all artifacts located under /rabbit in the **source-frog-repo** repository into the same path in the target-frog-repo repository without maintaining the original subdirectory hierarchy. ``` -jf rt cp "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --flat +jf rt mv "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --flat ``` ## Deleting Files From 1f52d281e56d1a9659531a1e3e91b2abc5f1acee Mon Sep 17 00:00:00 2001 From: Guy Delarea Date: Fri, 19 Apr 2024 08:06:06 +0300 Subject: [PATCH 3/3] update markdown wrapping --- .../jfrog-cli/cli-for-jfrog-artifactory/generic-files.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md b/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md index b36a784..9465154 100644 --- a/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md +++ b/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/generic-files.md @@ -266,7 +266,7 @@ jf rt cp "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --props=Version=1. #### Example 4 -Copy all artifacts located under /rabbit in the **source-frog-repo** repository into the same path in the target-frog-repo repository without maintaining the original subdirectory hierarchy. +Copy all artifacts located under /rabbit in the **source-frog-repo** repository into the same path in the **target-frog-repo** repository without maintaining the original subdirectory hierarchy. ``` jf rt cp "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --flat ``` @@ -338,7 +338,7 @@ jf rt mv "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --props=Version=1. #### Example 4 -Move all artifacts located under /rabbit in the **source-frog-repo** repository into the same path in the target-frog-repo repository without maintaining the original subdirectory hierarchy. +Move all artifacts located under /rabbit in the **source-frog-repo** repository into the same path in the **target-frog-repo** repository without maintaining the original subdirectory hierarchy. ``` jf rt mv "source-frog-repo/rabbit/*" target-frog-repo/rabbit/ --flat ```