You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

The SSH Run Script Action is used to run scripts on an SSH server. The action can either run an entire script or a list of commands. All output is written to the build log as it is received from the host. 

Host Name

The URL or IPv4 address of the SSH host to connect to. The host should be accessible from all agents able to run the build containing this action. If any connection issues are detected they will appear in the build log. Action will connect and represent itself as an xterm client. In addition it will use a channel to send commands so that it can easily detect when they have been completed. If a script is used in the action, SFTP will be used to upload the script to the host for execution. This guarantees that the script runs in the context of the host, and does not have to deal with any translation issues between the actions client and the server. Once run the script file will be removed from the SSH host. 

Port

The port number that the SSH host will be listening on. Port 22 is the default port for SSH hosts. 

Login Name

The name of the user under which all the commands will be run. The user will only be logged in for the lifetime of the action. 

Password

The password for the supplied user. This password is stored as an encrypted value within the action, and once entered will not be able to be read by those editing the action. It will also not appear in any logs. 

Run Option

Commands: The commands option allows for running of a sequence of commands in the action. The action will open a channel once connected and proceed to call each command in sequence waiting for the previous command to complete. Once all commands have been run, the channel and connection will be closed and the action will completed, returning the exitCode of the last run command. 

Script: The script option allows for a script to be uploaded to the SSH host and run locally under the users account. This allows for commands to be run in the context of the SSH host and to avoid any translation issues between the actions client implementation and the host in question. The script is uploaded using SFTP, placing the file in the base directory of the logged in user. This requires the user to be able to write and execute files in their base directory. The script is then updated to be executable, and then executed from the users base directory. The action will then wait for the script to complete, and then sets the Exit Code Variable to the last error code of the script. Before completing the action will remove the script file, and then close the channel and connection. 

Script File

The location of the script file to run. 

Script

This 

Private Key

Passphrase

Exit Code Variable

Script timeout

  • No labels