mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-22 10:10:39 +00:00
fixed issue with incorrect push command
This commit is contained in:
parent
a10a18b032
commit
63d8305bb7
@ -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
|
20
.drone.yml
20
.drone.yml
@ -1,25 +1,21 @@
|
||||
build:
|
||||
workspace:
|
||||
base: /go
|
||||
|
||||
script:
|
||||
test:
|
||||
image: golang:1.5
|
||||
image: golang:1.6
|
||||
environment:
|
||||
- CGO_ENABLED=0
|
||||
- GO15VENDOREXPERIMENT=1
|
||||
commands:
|
||||
- go test -cover -coverprofile=coverage.out
|
||||
- go build -ldflags "-s -w -X main.build=$DRONE_BUILD_NUMBER"
|
||||
|
||||
publish:
|
||||
coverage:
|
||||
when:
|
||||
branch: master
|
||||
docker:
|
||||
username: $$DOCKER_USER
|
||||
password: $$DOCKER_PASS
|
||||
email: $$DOCKER_EMAIL
|
||||
storage_driver: overlay
|
||||
repo: plugins/docker
|
||||
tag: latest
|
||||
when:
|
||||
branch: release/0.5
|
||||
branch: master
|
||||
event: push
|
||||
|
||||
plugin:
|
||||
name: Docker
|
||||
|
1
.drone.yml.sig
Normal file
1
.drone.yml.sig
Normal file
@ -0,0 +1 @@
|
||||
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9nbwoKc2NyaXB0OgogIHRlc3Q6CiAgICBpbWFnZTogZ29sYW5nOjEuNgogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gQ0dPX0VOQUJMRUQ9MAogICAgY29tbWFuZHM6CiAgICAgIC0gZ28gdGVzdCAtY292ZXIgLWNvdmVycHJvZmlsZT1jb3ZlcmFnZS5vdXQKICAgICAgLSBnbyBidWlsZCAtbGRmbGFncyAiLXMgLXcgLVggbWFpbi5idWlsZD0kRFJPTkVfQlVJTERfTlVNQkVSIgogIGRvY2tlcjoKICAgIHN0b3JhZ2VfZHJpdmVyOiBvdmVybGF5CiAgICByZXBvOiBwbHVnaW5zL2RvY2tlcgogICAgdGFnOiBsYXRlc3QKICAgIHdoZW46CiAgICAgIGJyYW5jaDogbWFzdGVyCiAgICAgIGV2ZW50OiBwdXNoCgpwbHVnaW46CiAgbmFtZTogRG9ja2VyCiAgZGVzYzogQnVpbGQgYW5kIHB1Ymxpc2ggaW1hZ2VzIHRvIGEgRG9ja2VyIHJlZ2lzdHJ5CiAgdHlwZTogcHVibGlzaAogIGltYWdlOiBwbHVnaW5zL2RvY2tlcgogIGxhYmVsczoKICAgIC0gZG9ja2VyCiAgICAtIGltYWdlCiAgICAtIGNvbnRhaW5lcgo.Dq7c7ARGLJBH7O4swFpXpulXAjuyHMfiJzRq6Xpc5RM
|
@ -19,6 +19,8 @@ Build the docker image with the following commands:
|
||||
```
|
||||
export GO15VENDOREXPERIMENT=1
|
||||
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:
|
||||
@ -37,7 +39,7 @@ docker run --rm \
|
||||
-e PLUGIN_TAG=latest \
|
||||
-e PLUGIN_REPO=octocat/hello-world \
|
||||
-e DRONE_COMMIT_SHA=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab \
|
||||
-v $(pwd)/$(pwd) \
|
||||
-v $(pwd):$(pwd) \
|
||||
-w $(pwd) \
|
||||
--privileged \
|
||||
plugins/docker --dry-run
|
||||
|
@ -100,7 +100,7 @@ func (p Plugin) Exec() error {
|
||||
cmds = append(cmds, commandTag(p.Build, tag)) // docker tag
|
||||
|
||||
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.
|
||||
func commandPush(tag string) *exec.Cmd {
|
||||
return exec.Command("/usr/bin/docker", "push", tag)
|
||||
func commandPush(build Build, tag string) *exec.Cmd {
|
||||
target := fmt.Sprintf("%s:%s", build.Repo, tag)
|
||||
return exec.Command("/usr/bin/docker", "push", target)
|
||||
}
|
||||
|
||||
// helper function to create the docker daemon command.
|
||||
|
Loading…
Reference in New Issue
Block a user