diff --git a/.drone.jsonnet b/.drone.jsonnet index ea298c0..3e06df5 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -72,6 +72,14 @@ local PipelineBuild(binary="docker", os="linux", arch="amd64") = { event: [ "tag" ], }, }, + if binary == "docker" then { + name: "executable", + image: "golang:1.11", + pull: "always", + commands: [ + "./release/" + os + "/" + arch + "/drone-" + binary + " --help", + ], + }, { name: "dryrun", image: "plugins/docker:" + os + "-" + arch, diff --git a/.drone.windows.yml b/.drone.windows.yml index 0d6099c..dc2b04c 100644 --- a/.drone.windows.yml +++ b/.drone.windows.yml @@ -32,6 +32,12 @@ steps: event: - tag +- name: executable + pull: always + image: golang:1.11 + commands: + - ./release/windows/amd64/drone-docker --help + - name: dryrun pull: always image: plugins/docker:windows-amd64 diff --git a/.drone.yml b/.drone.yml index 1af8690..db3c341 100644 --- a/.drone.yml +++ b/.drone.yml @@ -61,6 +61,12 @@ steps: event: - tag +- name: executable + pull: always + image: golang:1.11 + commands: + - ./release/linux/amd64/drone-docker --help + - name: dryrun pull: always image: plugins/docker:linux-amd64 @@ -135,6 +141,12 @@ steps: event: - tag +- name: executable + pull: always + image: golang:1.11 + commands: + - ./release/linux/arm64/drone-docker --help + - name: dryrun pull: always image: plugins/docker:linux-arm64 @@ -209,6 +221,12 @@ steps: event: - tag +- name: executable + pull: always + image: golang:1.11 + commands: + - ./release/linux/arm/drone-docker --help + - name: dryrun pull: always image: plugins/docker:linux-arm diff --git a/.github/settings.yml b/.github/settings.yml index 3a43817..f647429 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -58,7 +58,6 @@ branches: dismissal_restrictions: teams: - Admins - - Captain required_status_checks: strict: true contexts: @@ -66,4 +65,5 @@ branches: enforce_admins: false restrictions: users: [] - teams: [] + teams: + - Admins diff --git a/README.md b/README.md index 6debd57..b4bd438 100644 --- a/README.md +++ b/README.md @@ -8,22 +8,50 @@ [![Go Doc](https://godoc.org/github.com/drone-plugins/drone-docker?status.svg)](http://godoc.org/github.com/drone-plugins/drone-docker) [![Go Report](https://goreportcard.com/badge/github.com/drone-plugins/drone-docker)](https://goreportcard.com/report/github.com/drone-plugins/drone-docker) -Drone plugin to build and publish Docker images to a container registry. +Drone plugin to build and publish Docker images to a container registry. For the usage information and a listing of the available options please take a look at [the docs](http://plugins.drone.io/drone-plugins/drone-docker/). ## Build -Build the binary with the following commands: +Build the binaries with the following commands: ``` -sh .drone.sh +export GOOS=linux +export GOARCH=amd64 +export CGO_ENABLED=0 +export GO111MODULE=on + +go test -cover ./... + +go build -v -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker +go build -v -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr +go build -v -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr +go build -v -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku ``` ## Docker -Build the Docker image with the following commands: +Build the Docker images with the following commands: ``` -docker build --rm=true -f docker/Dockerfile -t plugins/docker . +docker build \ + --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ + --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \ + --file docker/docker/Dockerfile.linux.amd64 --tag plugins/docker . + +docker build \ + --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ + --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \ + --file docker/gcr/Dockerfile.linux.amd64 --tag plugins/gcr . + +docker build \ + --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ + --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \ + --file docker/ecr/Dockerfile.linux.amd64 --tag plugins/ecr . + +docker build \ + --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ + --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \ + --file docker/heroku/Dockerfile.linux.amd64 --tag plugins/heroku . ``` ## Usage