Skip to content
Drone plugin: git with ssh
Go Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.drone.yml
.gitignore
Dockerfile
LICENSE
README.md
go.mod
go.sum
main.go
plugin.go

README.md

drone-git-with-ssh

Build Status GoDoc Go Report Card

Drone plugin: git with ssh

Build

Build the binary with the following commands:

go build

Test

use drone cli

drone exec --event pull_request

Docker

Build the Docker image with the following commands:

GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/amd64/drone-git-with-ssh
docker build --rm -t matsubara0507/git-with-ssh .

Usage

$ ./drone-git-with-ssh --help
NAME:
   git-with-ssh plugin - git-with-ssh plugin

USAGE:
   drone-git-with-ssh [global options] command [command options] [arguments...]

VERSION:
   1.0.0+0

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --ssh_private_key value  SSH private key for git [$PLUGIN_SSH_PRIVATE_KEY]
   --ssh_hosts value        SSH hosts by git with ssh (disable StrictHostKeyChecking) [$PLUGIN_SSH_HOSTS]
   --commands value         shell commands [$PLUGIN_COMMANDS]
   --home value             home directory for ssh (default: "/root") [$PLUGIN_HOME]
   --env-file value         source env file
   --help, -h               show help
   --version, -v            print the version

Execute from the working directory:

docker run --rm \
  -e PLUGIN_SSH_PRIVATE_KEY=ssh_key \
  -e PLUGIN_SSH_HOSTS=github.com,bitbucket.org \
  -e PLUGIN_COMMANDS='git clone git@github.com:matsubara0507/drone-git-with-ssh.git' \
  -v $(pwd):/root/work \
  -w /root/work \
  matsubara0507/git-with-ssh
You can’t perform that action at this time.