jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
538 stars 236 forks source link

JFrogCLI Artifactory deploy fails citing wrong number of arguments. #188

Closed nvashon closed 6 years ago

nvashon commented 6 years ago

When running the command below from Powershell I get an error saying Wrong number of arguments. The same command runs successfully from the Windows command prompt on my Windows 10 local machine. However it gives the same error when running from the Windows Server 2012 R2 machine.

PS >.\jfrog.exe rt u C:\file.zip test –-url=https://artifactory/ –-user=xxxx –-password=xxxx

PS > .\jfrog.exe rt u C:\file.zip test –-url=https://artifactory/ –-user=xxxx –-password=xxx
x
[Error] Wrong number of arguments. You can read the documentation at https://www.jfrog.com/confluence/display/CLI/JFrog+
CLI

Name:
        jfrog rt upload - Upload files.

Usage:
        jfrog rt u [command options] <source pattern> <target pattern>
        jfrog rt u --spec=<File Spec path> [command options]

Arguments:
        source pattern
                Specifies the local file system path to artifacts which should be uploaded to Artifactory.
                You can specify multiple artifacts by using wildcards or a regular expression as designated by the --reg
exp command option.
                If you have specified that you are using regular expressions, then the first one used in the argument mu
st be enclosed in parenthesis.

        target pattern
                Specifies the target path in Artifactory in the following format: <repository name>/<repository path>.
                If the target path ends with a slash, the path is assumed to be a folder. For example, if you specify th
e target as "repo-name/a/b/",
                then "b" is assumed to be a folder in Artifactory into which files should be uploaded. If there is no te
rminal slash, the target path
                is assumed to be a file to which the uploaded file should be renamed. For example, if you specify the ta
rget as "repo-name/a/b",
                the uploaded file is renamed to "b" in Artifactory.
                For flexibility in specifying the upload path, you can include placeholders in the form of {1}, {2} whic
h are replaced by corresponding
                tokens in the source path that are enclosed in parenthesis.

Options:
        --url                   [Optional] Artifactory URL.
        --user                  [Optional] Artifactory username.
        --password              [Optional] Artifactory password.
        --apikey                [Optional] Artifactory API key.
        --ssh-key-path          [Optional] SSH key file path.
        --ssh-passphrase        [Optional] SSH key passphrase.
        --server-id             [Optional] Artifactory server ID configured using the config command.
        --spec                  [Optional] Path to a File Spec.
        --spec-vars             [Optional] List of variables in the form of "key1=value1;key2=value2;..." to be replaced
 in the File Spec. In the File Spec, the variables should be used as follows: ${key1}.
        --build-name            [Optional] Build name. Providing this option will record all uploaded artifacts for late
r build info publication.
        --build-number          [Optional] Build number. Providing this option will record all uploaded artifacts for la
ter build info publication.
        --props                 [Optional] List of properties in the form of "key1=value1;key2=value2,..." to be attache
d to the uploaded artifacts.
        --deb                   [Optional] Used for Debian packages in the form of distribution/component/architecture.
If the the value for distribution, component or architecture include a slash, the slash should be escaped with a back-sl
ash.
        --recursive             [Default: true] Set to false if you do not wish to collect artifacts in sub-folders to b
e uploaded to Artifactory.
        --flat                  [Default: true] If set to false, files are uploaded according to their file system hiera
rchy.
        --regexp                [Default: false] Set to true to use a regular expression instead of wildcards expression
 to collect files to upload.
        --dry-run               [Default: false] Set to true to disable communication with Artifactory.
        --explode               [Default: false] Set to true to extract an archive after it is deployed to Artifactory.
        --symlinks              [Default: false] Set to true to preserve symbolic links structure in Artifactory.
        --include-dirs          [Default: false] Set to true if you'd like to also apply the source path pattern for dir
ectories and not just for files.
        --fail-no-op            [Default: false] Set to true if you'd like the command to return exit code 2 in case of
no files are affected.
        --exclude-patterns      [Optional] Semicolon-separated list of exclude patterns. Exclude patterns may contain th
e * and the ? wildcards or a regex pattern, according to the value of the 'regexp' option.
        --threads               [Default: 3] Number of working threads.

Environment Variables:
        JFROG_CLI_MIN_CHECKSUM_DEPLOY_SIZE_KB
                [Default: 10]
                Minimum file size in KB for which JFrog CLI performs checksum deploy optimization.

        JFROG_CLI_LOG_LEVEL
                [Default: INFO]
                This variable determines the log level of the JFrog CLI.
                Possible values are: INFO, ERROR, and DEBUG.
                If set to ERROR, JFrog CLI logs error messages only.
                It is useful when you wish to read or parse the JFrog CLI output and do not want any other information l
ogged.

        JFROG_CLI_OFFER_CONFIG
                [Default: true]
                If true, JFrog CLI prompts for product server details and saves them in its config file.
                To avoid having automation scripts interrupted, set this value to false, and instead,
                provide product server details using the config command.

        JFROG_CLI_HOME
                [Default: ~/.jfrog]
                Defines the JFrog CLI home directory path.
DimaNevelev commented 6 years ago

@nvashon , In the command you provided you are using a unsupported dash sign. You can see this by trying to encode the command in a url encoder. You will see that the dash turns into "%20%E2%80%93" instead of remain "-". Please try to run the command with regular dash signs.

eyalbe4 commented 6 years ago

@nvashon, We're closing this issue for now. Please let us know if you need further assistance.