fixed issue with incorrect push command

This commit is contained in:
Brad Rydzewski 2016-05-04 12:51:06 -07:00
parent a10a18b032
commit 63d8305bb7
5 changed files with 16 additions and 17 deletions

View File

@ -1 +0,0 @@
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.JlxE-t1MnDlzY5ysWCSDXIjcwUHofIan5P9cfBYGZ6NchhQWXyDlC3daezqCfGqA4aOQk0Ig4Z1Vz1fI3RX_BPE9vRGmZMOLWMpc-BBgBtXke_prDPRmDKZkqFTKC2Ys7raCWgbj3Q8r_AKaJNdWxWNELAENOocsZNF2QZv-LdHb6KAGubeKXYoU2tKfcqrIiR9ChUiaW3ZuS_4rYl7xJsFhn5_hh964qCOVfOyO49kLd7kFhAE72OKIH_Oz_Xs0NYNI3O-5L1rhvVgdaI_70ZejzeNer_e85dt1B1HW63inx3hnFkab0WdASypxGNjOlZuvnu2VmlJi-lRG37cEWA.HgW6X32JWV04WHcP.DASErZ7lvDzxWz9jFUJ3lJpRNbdEU5tRMBTe01GEdP9wveHVlZTS_cruE-1i-Nbro7v8vYxuP7Hdruk36cnCMAcaSc4Z_PqkPsR3PyLMd_VV0A1zlabo706huy0wliMnr0F8G17x043J2yyYMPgiVjbImYD4xC2OL7SbQH0zkIuctGuzQ6K2Xwpc89n2-zPP6fddX4D1Wpwi7CP_f-Cr5lP0jevZW8vv__H0tRqxSRaw57aPh4viLQVgMqWxXMA.WypEt7MPRG9ujeCLP5800w

View File

@ -1,25 +1,21 @@
build: workspace:
base: /go
script:
test: test:
image: golang:1.5 image: golang:1.6
environment: environment:
- CGO_ENABLED=0 - CGO_ENABLED=0
- GO15VENDOREXPERIMENT=1
commands: commands:
- go test -cover -coverprofile=coverage.out - go test -cover -coverprofile=coverage.out
- go build -ldflags "-s -w -X main.build=$DRONE_BUILD_NUMBER" - go build -ldflags "-s -w -X main.build=$DRONE_BUILD_NUMBER"
publish:
coverage:
when:
branch: master
docker: docker:
username: $$DOCKER_USER storage_driver: overlay
password: $$DOCKER_PASS
email: $$DOCKER_EMAIL
repo: plugins/docker repo: plugins/docker
tag: latest tag: latest
when: when:
branch: release/0.5 branch: master
event: push
plugin: plugin:
name: Docker name: Docker

1
.drone.yml.sig Normal file
View File

@ -0,0 +1 @@
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9nbwoKc2NyaXB0OgogIHRlc3Q6CiAgICBpbWFnZTogZ29sYW5nOjEuNgogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gQ0dPX0VOQUJMRUQ9MAogICAgY29tbWFuZHM6CiAgICAgIC0gZ28gdGVzdCAtY292ZXIgLWNvdmVycHJvZmlsZT1jb3ZlcmFnZS5vdXQKICAgICAgLSBnbyBidWlsZCAtbGRmbGFncyAiLXMgLXcgLVggbWFpbi5idWlsZD0kRFJPTkVfQlVJTERfTlVNQkVSIgogIGRvY2tlcjoKICAgIHN0b3JhZ2VfZHJpdmVyOiBvdmVybGF5CiAgICByZXBvOiBwbHVnaW5zL2RvY2tlcgogICAgdGFnOiBsYXRlc3QKICAgIHdoZW46CiAgICAgIGJyYW5jaDogbWFzdGVyCiAgICAgIGV2ZW50OiBwdXNoCgpwbHVnaW46CiAgbmFtZTogRG9ja2VyCiAgZGVzYzogQnVpbGQgYW5kIHB1Ymxpc2ggaW1hZ2VzIHRvIGEgRG9ja2VyIHJlZ2lzdHJ5CiAgdHlwZTogcHVibGlzaAogIGltYWdlOiBwbHVnaW5zL2RvY2tlcgogIGxhYmVsczoKICAgIC0gZG9ja2VyCiAgICAtIGltYWdlCiAgICAtIGNvbnRhaW5lcgo.Dq7c7ARGLJBH7O4swFpXpulXAjuyHMfiJzRq6Xpc5RM

View File

@ -19,6 +19,8 @@ Build the docker image with the following commands:
``` ```
export GO15VENDOREXPERIMENT=1 export GO15VENDOREXPERIMENT=1
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo
docker build --rm=true -t plugins/docker .
``` ```
Please note incorrectly building the image for the correct x64 linux and with GCO disabled will result in an error when running the Docker image: Please note incorrectly building the image for the correct x64 linux and with GCO disabled will result in an error when running the Docker image:
@ -37,7 +39,7 @@ docker run --rm \
-e PLUGIN_TAG=latest \ -e PLUGIN_TAG=latest \
-e PLUGIN_REPO=octocat/hello-world \ -e PLUGIN_REPO=octocat/hello-world \
-e DRONE_COMMIT_SHA=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab \ -e DRONE_COMMIT_SHA=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab \
-v $(pwd)/$(pwd) \ -v $(pwd):$(pwd) \
-w $(pwd) \ -w $(pwd) \
--privileged \ --privileged \
plugins/docker --dry-run plugins/docker --dry-run

View File

@ -100,7 +100,7 @@ func (p Plugin) Exec() error {
cmds = append(cmds, commandTag(p.Build, tag)) // docker tag cmds = append(cmds, commandTag(p.Build, tag)) // docker tag
if p.Dryrun == false { if p.Dryrun == false {
cmds = append(cmds, commandPush(tag)) // docker push cmds = append(cmds, commandPush(p.Build, tag)) // docker push
} }
} }
@ -168,8 +168,9 @@ func commandTag(build Build, tag string) *exec.Cmd {
} }
// helper function to create the docker push command. // helper function to create the docker push command.
func commandPush(tag string) *exec.Cmd { func commandPush(build Build, tag string) *exec.Cmd {
return exec.Command("/usr/bin/docker", "push", tag) target := fmt.Sprintf("%s:%s", build.Repo, tag)
return exec.Command("/usr/bin/docker", "push", target)
} }
// helper function to create the docker daemon command. // helper function to create the docker daemon command.