{"id":13581800,"url":"https://github.com/appleboy/drone-scp","last_synced_at":"2025-05-15T05:03:31.853Z","repository":{"id":12128603,"uuid":"71052411","full_name":"appleboy/drone-scp","owner":"appleboy","description":"Copy files and artifacts via SSH using a binary, docker or Drone CI.","archived":false,"fork":false,"pushed_at":"2025-04-14T06:12:48.000Z","size":1131,"stargazers_count":149,"open_issues_count":22,"forks_count":32,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T08:15:44.486Z","etag":null,"topics":["cli","docker-container","docker-image","drone","drone-plugin","scp","ssh"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appleboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.paypal.me/appleboy46"]}},"created_at":"2016-10-16T13:35:56.000Z","updated_at":"2025-04-14T06:12:52.000Z","dependencies_parsed_at":"2024-05-21T17:05:07.650Z","dependency_job_id":"bc55c510-5211-43bd-ae5e-c36bc8ba9bd6","html_url":"https://github.com/appleboy/drone-scp","commit_stats":{"total_commits":310,"total_committers":8,"mean_commits":38.75,"dds":"0.029032258064516148","last_synced_commit":"2a9a5789ccc979aab28b74ffac43145202269f31"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-scp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-scp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-scp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-scp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleboy","download_url":"https://codeload.github.com/appleboy/drone-scp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248843958,"owners_count":21170496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","docker-container","docker-image","drone","drone-plugin","scp","ssh"],"created_at":"2024-08-01T15:02:14.982Z","updated_at":"2025-05-15T05:03:31.833Z","avatar_url":"https://github.com/appleboy.png","language":"Go","funding_links":["https://www.paypal.me/appleboy46"],"categories":["DevOps Tools","Go","Software Packages","软件包","Go 工具","Go Tools","軟件包"],"sub_categories":["DevOps Tools","devops 工具","DevOps 工具","代码分析","DevOps工具"],"readme":"# drone-scp\n\n[繁體中文](README.zh-tw.md) | [简体中文](README.zh-cn.md)\n\n[![GoDoc](https://godoc.org/github.com/appleboy/drone-scp?status.svg)](https://godoc.org/github.com/appleboy/drone-scp)\n[![Lint and Testing](https://github.com/appleboy/drone-scp/actions/workflows/testing.yml/badge.svg)](https://github.com/appleboy/drone-scp/actions/workflows/testing.yml)\n[![codecov](https://codecov.io/gh/appleboy/drone-scp/branch/master/graph/badge.svg)](https://codecov.io/gh/appleboy/drone-scp)\n[![Go Report Card](https://goreportcard.com/badge/github.com/appleboy/drone-scp)](https://goreportcard.com/report/github.com/appleboy/drone-scp)\n[![Docker Pulls](https://img.shields.io/docker/pulls/appleboy/drone-scp.svg)](https://hub.docker.com/r/appleboy/drone-scp/)\n\nSecurely transfer files and artifacts via SSH using a standalone binary, Docker container, or [Drone CI](http://docs.drone.io/) integration.\n\n## Features\n\n- [x] Parallel file transfer with multiple routines\n- [x] Support for wildcard patterns in source file selection\n- [x] Ability to transfer files to multiple destination hosts\n- [x] Support for multiple target directories on each host\n- [x] Flexible SSH key authentication via file path or raw content\n- [x] Advanced networking with SSH ProxyCommand support\n\n```sh\n+--------+       +----------+      +-----------+\n| Laptop | \u003c--\u003e  | Jumphost | \u003c--\u003e | FooServer |\n+--------+       +----------+      +-----------+\n\n                   OR\n\n+--------+       +----------+      +-----------+\n| Laptop | \u003c--\u003e  | Firewall | \u003c--\u003e | FooServer |\n+--------+       +----------+      +-----------+\n192.168.1.5       121.1.2.3         10.10.29.68\n```\n\n## Breaking changes\n\n`v1.5.0`: change command timeout flag to `Duration`. See the following setting:\n\n```diff\n  - name: scp files\n    image: appleboy/drone-scp\n    settings:\n      host:\n        - example1.com\n        - example2.com\n      username: ubuntu\n      password:\n        from_secret: ssh_password\n      port: 22\n-     command_timeout: 120\n+     command_timeout: 2m\n      target: /home/deploy/web\n      source:\n        - release/*.tar.gz\n```\n\n## Build or Download a binary\n\nThe pre-compiled binaries can be downloaded from [release page](https://github.com/appleboy/drone-scp/releases). Support the following OS type.\n\n- Windows amd64/386\n- Linux arm/amd64/386\n- Darwin amd64/386\n\nWith `Go` installed\n\n```sh\nexport GO111MODULE=on\ngo get -u -v github.com/appleboy/drone-scp\n```\n\nor build the binary with the following command:\n\n```sh\nexport GOOS=linux\nexport GOARCH=amd64\nexport CGO_ENABLED=0\nexport GO111MODULE=on\n\ngo test -cover ./...\n\ngo build -v -a -tags netgo -o release/linux/amd64/drone-scp .\n```\n\n## Docker\n\nBuild the docker image with the following commands:\n\n```sh\nmake docker\n```\n\n## Usage\n\nThere are three ways to send notification.\n\n- [usage from binary](#usage-from-binary)\n- [usage from docker](#usage-from-docker)\n- [usage from drone ci](#usage-from-drone-ci)\n\n### Usage from binary\n\n#### Using public key\n\n```bash\ndrone-scp --host example.com \\\n  --port 22 \\\n  --username appleboy \\\n  --key-path \"${HOME}/.ssh/id_rsa\" \\\n  --target /home/appleboy/test \\\n  --source your_local_folder_path\n```\n\n#### Using password\n\n```diff\ndrone-scp --host example.com \\\n  --port 22 \\\n  --username appleboy \\\n+ --password xxxxxxx \\\n  --target /home/appleboy/test \\\n  --source your_local_folder_path\n```\n\n#### Using ssh-agent\n\nStart your local ssh agent:\n\n```bash\neval `ssh-agent -s`\n```\n\nImport your local public key `~/.ssh/id_rsa`\n\n```sh\nssh-add\n```\n\nYou don't need to add `--password` or `--key-path` arguments.\n\n```bash\ndrone-scp --host example.com \\\n  --port 22 \\\n  --username appleboy \\\n  --target /home/appleboy/test \\\n  --source your_local_folder_path\n```\n\n#### Send multiple source or target folder and hosts\n\n```diff\ndrone-scp --host example1.com \\\n+ --host example2.com \\\n  --port 22 \\\n  --username appleboy \\\n  --password  xxxxxxx\n  --target /home/appleboy/test1 \\\n+ --target /home/appleboy/test2 \\\n  --source your_local_folder_path_1\n+ --source your_local_folder_path_2\n```\n\n### Usage from docker\n\nUsing public key\n\n```bash\ndocker run --rm \\\n  -e SCP_HOST=example.com \\\n  -e SCP_USERNAME=xxxxxxx \\\n  -e SCP_PORT=22 \\\n  -e SCP_KEY_PATH=\"${HOME}/.ssh/id_rsa\"\n  -e SCP_SOURCE=SOURCE_FILE_LIST \\\n  -e SCP_TARGET=TARGET_FOLDER_PATH \\\n  -v $(pwd):$(pwd) \\\n  -w $(pwd) \\\n  appleboy/drone-scp\n```\n\nUsing password\n\n```diff\ndocker run --rm \\\n  -e SCP_HOST=example.com \\\n  -e SCP_USERNAME=xxxxxxx \\\n  -e SCP_PORT=22 \\\n+ -e SCP_PASSWORD=\"xxxxxxx\"\n  -e SCP_SOURCE=SOURCE_FILE_LIST \\\n  -e SCP_TARGET=TARGET_FOLDER_PATH \\\n  -v $(pwd):$(pwd) \\\n  -w $(pwd) \\\n  appleboy/drone-scp\n```\n\nUsing ssh-agent, start your local ssh agent:\n\n```bash\neval `ssh-agent -s`\n```\n\nImport your local public key `~/.ssh/id_rsa`\n\n```sh\nssh-add\n```\n\nYou don't need to add `SCP_PASSWORD` or `SCP_KEY_PATH` arguments.\n\n```bash\ndocker run --rm \\\n  -e SCP_HOST=example.com \\\n  -e SCP_USERNAME=xxxxxxx \\\n  -e SCP_PORT=22 \\\n  -e SCP_SOURCE=SOURCE_FILE_LIST \\\n  -e SCP_TARGET=TARGET_FOLDER_PATH \\\n  -v $(pwd):$(pwd) \\\n  -w $(pwd) \\\n  appleboy/drone-scp\n```\n\nSend multiple source or target folder and hosts\n\n```bash\ndocker run --rm \\\n  -e SCP_HOST=example1.com,example2.com \\\n  -e SCP_USERNAME=xxxxxxx \\\n  -e SCP_PASSWORD=xxxxxxx \\\n  -e SCP_PORT=22 \\\n  -e SCP_SOURCE=SOURCE_FILE_LIST_1,SOURCE_FILE_LIST_2 \\\n  -e SCP_TARGET=TARGET_FOLDER_PATH_1,TARGET_FOLDER_PATH_2 \\\n  -v $(pwd):$(pwd) \\\n  -w $(pwd) \\\n  appleboy/drone-scp\n```\n\n### Usage from drone ci\n\nExecute from the working directory:\n\n```bash\ndocker run --rm \\\n  -e PLUGIN_HOST=example.com \\\n  -e PLUGIN_USERNAME=xxxxxxx \\\n  -e PLUGIN_PASSWORD=xxxxxxx \\\n  -e PLUGIN_PORT=xxxxxxx \\\n  -e PLUGIN_SOURCE=SOURCE_FILE_LIST \\\n  -e PLUGIN_TARGET=TARGET_FOLDER_PATH \\\n  -e PLUGIN_RM=false \\\n  -e PLUGIN_DEBUG=true \\\n  -v $(pwd):$(pwd) \\\n  -w $(pwd) \\\n  appleboy/drone-scp\n```\n\nYou can get more [information](http://plugins.drone.io/appleboy/drone-scp/) about how to use scp in drone.\n\n## Testing\n\nTest the package with the following command:\n\n```sh\nmake test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fdrone-scp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleboy%2Fdrone-scp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fdrone-scp/lists"}