Remote Upload Command
Purpose
The Remote Upload command provides a platform-agnostic mechanism to upload files from your build system to a target host. This command…
uses the SFTP protocol,
authenticates using either a username/password or SSH Private Key, and
uses ANT File Patterns
Note that all directories matched by transfer patterns are created in the -destination folder.
Note that the -privateKey parameter is the name of a private key file accessible your mettleci remote execute command. If used as part of a CI/CD pipeline then the build agent process running the command will need access to the specified private key file.
Syntax
Syntax : remote upload [options]
Description
-source
Directory to be transferred from
-destination
Directory to be transferred to
Required
-transferPattern
Pattern of files to include
Required
-username
Username when connecting to remote server
Required
-password
Password when connecting to remote server, required when -privateKey is not used
-privateKey
Private SSH key, required when -password is not used
-passphrase
SSH key pass phrase
-host
URL of the server
Required
-port
SSH Port
Examples
Successful upload:
$> mettleci remote upload
-host remote_host \
-username myuser \
-password mypassword \
-source "C:\source-dir/." \
-destination target-dir \
-transferPattern "filesystem/**/*,config/*"
MettleCI Command Line (build 128)
(C) 2018-2022 Data Migrators Pty Ltd
Connecting to remote_host on port 22
Uploading 'filesystem/**/*,config/*' from local directory 'C:/source-dir/' to remote directory '/home/myuser/target-dir/':
config\cleanup.sh - SUCCESS
config\cleanup_unittest.sh - SUCCESS
config\deploy.sh - SUCCESS
config\DSParams - SUCCESS
filesystem\deploy.sh - SUCCESS
Done. 5 files transferred.
Failed upload:
$> mettleci remote upload
-host remote_host
-username myuser
-password mypassword
-source "C:\source-dir/."
-destination target-dir
-transferPattern "bad_pattern/*"
MettleCI Command Line (build 128)
(C) 2018-2022 Data Migrators Pty Ltd
Connecting to remote_host on port 22
Uploading 'bad_pattern/*' from local directory from local directory 'C:/source-dir/' to remote directory '/home/myuser/target-dir/':
Done. 0 files transferred.
See Also
- Build Pipeline SFTP operations fail due to DataStage Engine name
- MettleCI command 'workbench set-branch' command produces a credentials error
- MettleCI CLI produces 'Failed to connect to host' error
- SSH Configuration
- Workbench operations return ‘Could not find specified assets’
- MettleCI CLI produces error 'Incorrectly typed data found for annotation element'