mirror of
				https://github.com/appleboy/drone-ssh.git
				synced 2025-11-04 01:10:10 +08:00 
			
		
		
		
	用作 cicd/ssh-action 仓库基础组件
			
		
		
		
		
		
		
		
		
		
		
		
			| .drone.sec | ||
| .drone.yml | ||
| .gitignore | ||
| Dockerfile | ||
| DOCS.md | ||
| LICENSE | ||
| logo.svg | ||
| main_test.go | ||
| main.go | ||
| MAINTAINERS | ||
| Makefile | ||
| README.md | ||
| types.go | ||
drone-ssh
Drone plugin to execute commands on a remote host through SSH
Binary
Build the binary using make:
make deps build
Example
./drone-ssh <<EOF
{
    "repo": {
        "clone_url": "git://github.com/drone/drone",
        "owner": "drone",
        "name": "drone",
        "full_name": "drone/drone"
    },
    "system": {
        "link_url": "https://beta.drone.io"
    },
    "build": {
        "number": 22,
        "status": "success",
        "started_at": 1421029603,
        "finished_at": 1421029813,
        "message": "Update the Readme",
        "author": "johnsmith",
        "author_email": "john.smith@gmail.com"
        "event": "push",
        "branch": "master",
        "commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
        "ref": "refs/heads/master"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/github.com/drone/drone"
    },
    "vargs": {
        "host": "foo.com",
        "user": "root",
        "port": 22,
        "commands": [
            "echo hello",
            "echo world"
        ]
    }
}
EOF
Docker
Build the container using make:
make deps docker
Example
docker run -i plugins/drone-ssh <<EOF
{
    "repo": {
        "clone_url": "git://github.com/drone/drone",
        "owner": "drone",
        "name": "drone",
        "full_name": "drone/drone"
    },
    "system": {
        "link_url": "https://beta.drone.io"
    },
    "build": {
        "number": 22,
        "status": "success",
        "started_at": 1421029603,
        "finished_at": 1421029813,
        "message": "Update the Readme",
        "author": "johnsmith",
        "author_email": "john.smith@gmail.com"
        "event": "push",
        "branch": "master",
        "commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
        "ref": "refs/heads/master"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/github.com/drone/drone"
    },
    "vargs": {
        "host": "foo.com",
        "user": "root",
        "port": 22,
        "commands": [
            "echo hello",
            "echo world"
        ]
    }
}
EOF