用作 cicd/ssh-action 仓库基础组件
Go to file
2016-02-21 11:38:18 +01:00
.drone.sec Unification: Drone config, Makefile, structure and badges 2016-01-27 16:12:18 +01:00
.drone.yml Unification: Drone config, Makefile, structure and badges 2016-01-27 16:12:18 +01:00
.gitignore Updated gitignore to respect also coverage.out 2016-02-21 11:38:18 +01:00
Dockerfile Updated dockerfile to latest alpine image and updated docs 2016-01-01 21:34:17 +01:00
DOCS.md add sleep option 2015-10-30 11:21:11 -07:00
LICENSE Initial commit 2015-10-20 11:05:53 -07:00
logo.svg initial commit for ssh plugin 2015-10-21 12:34:42 -07:00
main_test.go Minor code refactoring 2016-01-01 21:36:08 +01:00
main.go Make the builds reproducable based on commit sha 2016-02-21 11:06:41 +01:00
MAINTAINERS Updated maintainers file, added names and athieriot 2016-02-21 11:20:01 +01:00
Makefile Make the builds reproducable based on commit sha 2016-02-21 11:06:41 +01:00
README.md Unification: Drone config, Makefile, structure and badges 2016-01-27 16:12:18 +01:00
types.go Use the drone-go StringSlice instead of custom implementation 2016-01-01 21:35:10 +01:00

drone-ssh

Build Status Coverage Status

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