rename sftp to scp.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
d63cf1ae3a
commit
6731fdf7af
|
@ -1,5 +1,5 @@
|
|||
FROM centurylink/ca-certs
|
||||
|
||||
ADD drone-sftp /
|
||||
ADD drone-scp /
|
||||
|
||||
ENTRYPOINT ["/drone-sftp"]
|
||||
ENTRYPOINT ["/drone-scp"]
|
||||
|
|
|
@ -4,5 +4,5 @@ RUN apk update && \
|
|||
apk add ca-certificates && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
ADD drone-sftp /bin/
|
||||
ENTRYPOINT ["/bin/drone-sftp"]
|
||||
ADD drone-scp /bin/
|
||||
ENTRYPOINT ["/bin/drone-scp"]
|
||||
|
|
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@
|
|||
|
||||
VERSION := $(shell git describe --tags || git rev-parse --short HEAD)
|
||||
DEPLOY_ACCOUNT := "appleboy"
|
||||
DEPLOY_IMAGE := "drone-sftp"
|
||||
DEPLOY_IMAGE := "drone-scp"
|
||||
|
||||
ifneq ($(shell uname), Darwin)
|
||||
EXTLDFLAGS = -extldflags "-static" $(null)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# drone-sftp
|
||||
# drone-scp
|
||||
|
||||
[](https://travis-ci.org/appleboy/drone-sftp) [](https://codecov.io/gh/appleboy/drone-sftp) [](https://goreportcard.com/report/github.com/appleboy/drone-sftp)
|
||||
[](https://travis-ci.org/appleboy/drone-scp) [](https://codecov.io/gh/appleboy/drone-scp) [](https://goreportcard.com/report/github.com/appleboy/drone-scp)
|
||||
|
||||
[Drone](https://github.com/drone/drone) plugin to publish files and artifacts via SFTP.
|
||||
|
||||
|
@ -33,7 +33,7 @@ GCO disabled will result in an error when running the Docker image:
|
|||
|
||||
```
|
||||
docker: Error response from daemon: Container command
|
||||
'/bin/drone-sftp' not found or does not exist..
|
||||
'/bin/drone-scp' not found or does not exist..
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
@ -56,5 +56,5 @@ docker run --rm \
|
|||
-e DRONE_BUILD_LINK=http://github.com/appleboy/go-hello \
|
||||
-v $(pwd):$(pwd) \
|
||||
-w $(pwd) \
|
||||
appleboy/drone-sftp
|
||||
appleboy/drone-scp
|
||||
```
|
||||
|
|
10
main.go
10
main.go
|
@ -20,23 +20,23 @@ func main() {
|
|||
cli.StringFlag{
|
||||
Name: "host",
|
||||
Usage: "Server host",
|
||||
EnvVar: "PLUGIN_HOST,SFTP_HOST",
|
||||
EnvVar: "PLUGIN_HOST,SCP_HOST",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "port",
|
||||
Value: "22",
|
||||
Usage: "Server port, default to 22",
|
||||
EnvVar: "PLUGIN_PORT,SFTP_PORT",
|
||||
EnvVar: "PLUGIN_PORT,SCP_PORT",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "username",
|
||||
Usage: "Server username",
|
||||
EnvVar: "PLUGIN_USERNAME,SFTP_USERNAME",
|
||||
EnvVar: "PLUGIN_USERNAME,SCP_USERNAME",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "password",
|
||||
Usage: "Password for password-based authentication",
|
||||
EnvVar: "PLUGIN_PASSWORD,SFTP_PASSWORD",
|
||||
EnvVar: "PLUGIN_PASSWORD,SCP_PASSWORD",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "path",
|
||||
|
@ -46,7 +46,7 @@ func main() {
|
|||
},
|
||||
cli.StringSliceFlag{
|
||||
Name: "files",
|
||||
Usage: "sftp files list",
|
||||
Usage: "scp file list",
|
||||
EnvVar: "PLUGIN_FILE",
|
||||
},
|
||||
cli.StringFlag{
|
||||
|
|
|
@ -61,9 +61,9 @@ func trimElement(keys []string) []string {
|
|||
func (p Plugin) Exec() error {
|
||||
|
||||
if len(p.Config.Host) == 0 || len(p.Config.Username) == 0 || len(p.Config.Password) == 0 {
|
||||
log.Println("missing sftp config")
|
||||
log.Println("missing ssh config")
|
||||
|
||||
return errors.New("missing sftp config")
|
||||
return errors.New("missing ssh config")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue