{"id":13983827,"url":"https://github.com/appleboy/drone-ssh","last_synced_at":"2025-05-14T09:06:32.734Z","repository":{"id":40689633,"uuid":"44625341","full_name":"appleboy/drone-ssh","owner":"appleboy","description":"Drone plugin for executing remote ssh commands","archived":false,"fork":false,"pushed_at":"2025-04-27T01:46:04.000Z","size":5252,"stargazers_count":281,"open_issues_count":20,"forks_count":82,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-14T09:05:08.807Z","etag":null,"topics":["cli","docker-container","docker-image","drone","drone-plugin","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":"2015-10-20T18:05:53.000Z","updated_at":"2025-05-12T13:58:53.000Z","dependencies_parsed_at":"2024-01-22T16:33:41.000Z","dependency_job_id":"6cdfd7d5-311f-49dc-b7f2-053f3a2459e0","html_url":"https://github.com/appleboy/drone-ssh","commit_stats":{"total_commits":358,"total_committers":20,"mean_commits":17.9,"dds":0.1871508379888268,"last_synced_commit":"883f947b4f1d140f8fbc30c5917d8225256991ad"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-ssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-ssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-ssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-ssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleboy","download_url":"https://codeload.github.com/appleboy/drone-ssh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"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","ssh"],"created_at":"2024-08-09T05:01:57.106Z","updated_at":"2025-05-14T09:06:32.727Z","avatar_url":"https://github.com/appleboy.png","language":"Go","readme":"# drone-ssh\n\n\u003e **English** | [繁體中文](./README.zh-tw.md) | [简体中文](./README.zh-cn.md)\n\n![sshlog](images/ssh.png)\n\n[![GitHub tag](https://img.shields.io/github/tag/appleboy/drone-ssh.svg)](https://github.com/appleboy/drone-ssh/releases)\n[![GoDoc](https://godoc.org/github.com/appleboy/drone-ssh?status.svg)](https://godoc.org/github.com/appleboy/drone-ssh)\n[![Lint and Testing](https://github.com/appleboy/drone-ssh/actions/workflows/testing.yml/badge.svg?branch=master)](https://github.com/appleboy/drone-ssh/actions/workflows/testing.yml)\n[![codecov](https://codecov.io/gh/appleboy/drone-ssh/branch/master/graph/badge.svg)](https://codecov.io/gh/appleboy/drone-ssh)\n[![Go Report Card](https://goreportcard.com/badge/github.com/appleboy/drone-ssh)](https://goreportcard.com/report/github.com/appleboy/drone-ssh)\n[![Docker Pulls](https://img.shields.io/docker/pulls/appleboy/drone-ssh.svg)](https://hub.docker.com/r/appleboy/drone-ssh/)\n\nA Drone plugin for executing commands on remote hosts via SSH. For usage instructions and a list of available options, please refer to [the documentation](http://plugins.drone.io/appleboy/drone-ssh/).\n\n**Note: Please update your Drone image config path to `appleboy/drone-ssh`. The `plugins/ssh` image is no longer maintained.**\n\n![demo](./images/demo2017.05.10.gif)\n\n## Table of Contents\n\n- [drone-ssh](#drone-ssh)\n  - [Table of Contents](#table-of-contents)\n  - [Breaking Changes](#breaking-changes)\n  - [Build or Download a Binary](#build-or-download-a-binary)\n  - [Docker](#docker)\n  - [Usage](#usage)\n  - [Mount Key from File Path](#mount-key-from-file-path)\n  - [Configuration](#configuration)\n\n## Breaking Changes\n\nAs of `v1.5.0`, the command timeout flag has changed to use the `Duration` format. See the following example:\n\n```diff\npipeline:\n  scp:\n    image: ghcr.io/appleboy/drone-ssh\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      script:\n        - echo \"Hello World\"\n```\n\n## Build or Download a Binary\n\nPre-compiled binaries are available on the [releases page](https://github.com/appleboy/drone-ssh/releases), supporting the following operating systems:\n\n- Windows amd64/386\n- Linux arm/amd64/386\n- macOS (Darwin) amd64/386\n\nIf you have `Go` installed:\n\n```sh\ngo install github.com/appleboy/drone-ssh@latest\n```\n\nOr build the binary manually with the following commands:\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-ssh .\n```\n\n## Docker\n\nBuild the Docker image with the following command:\n\n```sh\nmake docker\n```\n\n## Usage\n\nRun from your working directory:\n\n```sh\ndocker run --rm \\\n  -e PLUGIN_HOST=foo.com \\\n  -e PLUGIN_USERNAME=root \\\n  -e PLUGIN_KEY=\"$(cat ${HOME}/.ssh/id_rsa)\" \\\n  -e PLUGIN_SCRIPT=whoami \\\n  -v $(pwd):$(pwd) \\\n  -w $(pwd) \\\n  ghcr.io/appleboy/drone-ssh\n```\n\n## Mount Key from File Path\n\nMake sure to enable `trusted` mode in your project settings (for [Drone 0.8 version](https://0-8-0.docs.drone.io/)).\n\n![trusted mode](./images/trust.png)\n\nMount the private key in the `volumes` section of your `.drone.yml` config:\n\n```diff\npipeline:\n  ssh:\n    image: ghcr.io/appleboy/drone-ssh\n    host: xxxxx.com\n    username: deploy\n+   volumes:\n+     - /root/drone_rsa:/root/ssh/drone_rsa\n    key_path: /root/ssh/drone_rsa\n    script:\n      - echo \"test ssh\"\n```\n\nSee details in [this issue comment](https://github.com/appleboy/drone-ssh/issues/51#issuecomment-336732928).\n\n## Configuration\n\nSee [DOCS.md](./DOCS.md) for examples and full configuration options.\n\nConfiguration options are loaded from multiple sources:\n\n0. Hardcoded drone-ssh defaults. See [main.go CLI Flags](https://github.com/appleboy/drone-ssh/blob/6d9d6acc6aef1f9166118c6ba8bd214d3a582bdb/main.go#L39) for more information.\n1. From a dotenv file at a path specified by the `PLUGIN_ENV_FILE` environment variable.\n2. From your `.drone.yml` Drone configuration.\n\nLater sources override earlier ones. For example, if `PORT` is set in an `.env` file committed in the repository or created by previous test steps, it will override the default set in `main.go`.\n","funding_links":["https://www.paypal.me/appleboy46"],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fdrone-ssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleboy%2Fdrone-ssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fdrone-ssh/lists"}