Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from drone-plugins/restructure
Replaced old build process with current drone config
- Loading branch information
Showing
19 changed files
with
339 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
version: '{build}' | ||
image: 'Visual Studio 2017' | ||
platform: 'x64' | ||
|
||
clone_folder: 'c:\gopath\src\github.com\drone-plugins\drone-dockerhub' | ||
max_jobs: 1 | ||
|
||
environment: | ||
GOPATH: c:\gopath | ||
DOCKER_USERNAME: | ||
secure: '4YzzahbEiMZQJpOCOd1LAw==' | ||
DOCKER_PASSWORD: | ||
secure: 'VqO/G3Zfslu6zSLdwHKO+Q==' | ||
|
||
install: | ||
- ps: | | ||
docker version | ||
go version | ||
- ps: | | ||
$env:Path = "c:\gopath\bin;$env:Path" | ||
build_script: | ||
- ps: | | ||
go get -u github.com/golang/dep/cmd/dep | ||
dep ensure | ||
if ( $env:APPVEYOR_REPO_TAG -eq 'false' ) { | ||
go build -ldflags "-X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o release/drone-dockerhub.exe | ||
} else { | ||
$version = $env:APPVEYOR_REPO_TAG_NAME.substring(1) | ||
go build -ldflags "-X main.version=$version -X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o release/drone-dockerhub.exe | ||
} | ||
docker pull microsoft/nanoserver:10.0.14393.1593 | ||
docker build -f Dockerfile.windows -t plugins/dockerhub:windows-amd64 . | ||
# test_script: | ||
# - ps: | | ||
# docker run --rm plugins/dockerhub:windows-amd64 --version | ||
|
||
# deploy_script: | ||
# - ps: | | ||
# $ErrorActionPreference = 'Stop'; | ||
|
||
# if ( $env:APPVEYOR_PULL_REQUEST_NUMBER ) { | ||
# Write-Host Nothing to deploy. | ||
# } else { | ||
# echo $env:DOCKER_PASSWORD | docker login --username $env:DOCKER_USERNAME --password-stdin | ||
|
||
# if ( $env:APPVEYOR_REPO_TAG -eq 'true' ) { | ||
# $major,$minor,$patch = $env:APPVEYOR_REPO_TAG_NAME.substring(1).split('.') | ||
|
||
# docker push plugins/dockerhub:windows-amd64 | ||
|
||
# docker tag plugins/dockerhub:windows-amd64 plugins/dockerhub:$major.$minor.$patch-windows-amd64 | ||
# docker push plugins/dockerhub:$major.$minor.$patch-windows-amd64 | ||
|
||
# docker tag plugins/dockerhub:windows-amd64 plugins/dockerhub:$major.$minor-windows-amd64 | ||
# docker push plugins/dockerhub:$major.$minor-windows-amd64 | ||
|
||
# docker tag plugins/dockerhub:windows-amd64 plugins/dockerhub:$major-windows-amd64 | ||
# docker push plugins/dockerhub:$major-windows-amd64 | ||
# } else { | ||
# if ( $env:APPVEYOR_REPO_BRANCH -eq 'master' ) { | ||
# docker push plugins/dockerhub:windows-amd64 | ||
# } | ||
# } | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!release/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,148 @@ | ||
build: | ||
image: golang:1.5 | ||
environment: | ||
- CGO_ENABLED=0 | ||
commands: | ||
- make deps | ||
- make vet | ||
- make build | ||
- make test | ||
|
||
publish: | ||
coverage: | ||
when: | ||
branch: master | ||
docker: | ||
username: $$DOCKER_USER | ||
password: $$DOCKER_PASS | ||
email: $$DOCKER_EMAIL | ||
repo: plugins/drone-dockerhub | ||
tag: latest | ||
when: | ||
branch: master | ||
docker: | ||
username: $$DOCKER_USER | ||
password: $$DOCKER_PASS | ||
email: $$DOCKER_EMAIL | ||
repo: plugins/drone-dockerhub | ||
tag: develop | ||
when: | ||
branch: develop | ||
|
||
plugin: | ||
name: DockerHub | ||
desc: Trigger a DockerHub remote build | ||
type: publish | ||
image: plugins/drone-dockerhub | ||
labels: | ||
- docker | ||
workspace: | ||
base: /go | ||
path: src/github.com/drone-plugins/drone-dockerhub | ||
|
||
pipeline: | ||
deps: | ||
image: golang:1.10 | ||
pull: true | ||
commands: | ||
- go get -u github.com/golang/dep/cmd/dep | ||
- dep ensure | ||
|
||
test: | ||
image: golang:1.10 | ||
pull: true | ||
commands: | ||
- go vet ./... | ||
- go test -cover ./... | ||
|
||
build_linux_amd64: | ||
image: golang:1.10 | ||
pull: true | ||
group: build | ||
environment: | ||
- GOOS=linux | ||
- GOARCH=amd64 | ||
- CGO_ENABLED=0 | ||
commands: | ||
- | | ||
if test "${DRONE_TAG}" = ""; then | ||
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-dockerhub | ||
else | ||
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-dockerhub | ||
fi | ||
build_linux_i386: | ||
image: golang:1.10 | ||
pull: true | ||
group: build | ||
environment: | ||
- GOOS=linux | ||
- GOARCH=386 | ||
- CGO_ENABLED=0 | ||
commands: | ||
- | | ||
if test "${DRONE_TAG}" = ""; then | ||
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/drone-dockerhub | ||
else | ||
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/drone-dockerhub | ||
fi | ||
build_linux_arm64: | ||
image: golang:1.10 | ||
pull: true | ||
group: build | ||
environment: | ||
- GOOS=linux | ||
- GOARCH=arm64 | ||
- CGO_ENABLED=0 | ||
commands: | ||
- | | ||
if test "${DRONE_TAG}" = ""; then | ||
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-dockerhub | ||
else | ||
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-dockerhub | ||
fi | ||
build_linux_arm: | ||
image: golang:1.10 | ||
pull: true | ||
group: build | ||
environment: | ||
- GOOS=linux | ||
- GOARCH=arm | ||
- CGO_ENABLED=0 | ||
- GOARM=7 | ||
commands: | ||
- | | ||
if test "${DRONE_TAG}" = ""; then | ||
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-dockerhub | ||
else | ||
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-dockerhub | ||
fi | ||
# publish_linux_amd64: | ||
# image: plugins/docker:17.12 | ||
# pull: true | ||
# secrets: [ docker_username, docker_password ] | ||
# group: docker | ||
# repo: plugins/dockerhub | ||
# auto_tag: true | ||
# auto_tag_suffix: linux-amd64 | ||
# dockerfile: Dockerfile | ||
# when: | ||
# event: [ push, tag ] | ||
|
||
# publish_linux_i386: | ||
# image: plugins/docker:17.12 | ||
# pull: true | ||
# secrets: [ docker_username, docker_password ] | ||
# group: docker | ||
# repo: plugins/dockerhub | ||
# auto_tag: true | ||
# auto_tag_suffix: linux-i386 | ||
# dockerfile: Dockerfile.i386 | ||
# when: | ||
# event: [ push, tag ] | ||
|
||
# publish_linux_arm64: | ||
# image: plugins/docker:17.12 | ||
# pull: true | ||
# secrets: [ docker_username, docker_password ] | ||
# group: docker | ||
# repo: plugins/dockerhub | ||
# auto_tag: true | ||
# auto_tag_suffix: linux-arm64 | ||
# dockerfile: Dockerfile.arm64 | ||
# when: | ||
# event: [ push, tag ] | ||
|
||
# publish_linux_arm: | ||
# image: plugins/docker:17.12 | ||
# pull: true | ||
# secrets: [ docker_username, docker_password ] | ||
# group: docker | ||
# repo: plugins/dockerhub | ||
# auto_tag: true | ||
# auto_tag_suffix: linux-arm | ||
# dockerfile: Dockerfile.arm | ||
# when: | ||
# event: [ push, tag ] | ||
|
||
# manifests: | ||
# image: plugins/manifest:1 | ||
# pull: true | ||
# secrets: [ docker_username, docker_password ] | ||
# spec: manifest.tmpl | ||
# auto_tag: true | ||
# ignore_missing: true | ||
# when: | ||
# event: [ push, tag ] | ||
|
||
# microbadger: | ||
# image: plugins/webhook:1 | ||
# pull: true | ||
# secrets: [ webhook_url ] | ||
# when: | ||
# status: [ success ] |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ _testmain.go | |
*.test | ||
*.prof | ||
|
||
release/ | ||
vendor/ | ||
|
||
coverage.out | ||
drone-dockerhub | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Docker image for Drone's DockerHub plugin | ||
# | ||
# CGO_ENABLED=0 go build -a -tags netgo | ||
# docker build --rm=true -t plugins/drone-dockerhub . | ||
FROM plugins/base:multiarch | ||
|
||
FROM gliderlabs/alpine:3.1 | ||
RUN apk-install ca-certificates | ||
ADD drone-dockerhub /bin/ | ||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \ | ||
org.label-schema.name="Drone DockerHub" \ | ||
org.label-schema.vendor="Drone.IO Community" \ | ||
org.label-schema.schema-version="1.0" | ||
|
||
ADD release/linux/amd64/drone-dockerhub /bin/ | ||
ENTRYPOINT ["/bin/drone-dockerhub"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM plugins/base:multiarch | ||
|
||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \ | ||
org.label-schema.name="Drone DockerHub" \ | ||
org.label-schema.vendor="Drone.IO Community" \ | ||
org.label-schema.schema-version="1.0" | ||
|
||
ADD release/linux/arm/drone-dockerhub /bin/ | ||
ENTRYPOINT ["/bin/drone-dockerhub"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM plugins/base:multiarch | ||
|
||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \ | ||
org.label-schema.name="Drone DockerHub" \ | ||
org.label-schema.vendor="Drone.IO Community" \ | ||
org.label-schema.schema-version="1.0" | ||
|
||
ADD release/linux/arm64/drone-dockerhub /bin/ | ||
ENTRYPOINT ["/bin/drone-dockerhub"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM plugins/base:multiarch | ||
|
||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \ | ||
org.label-schema.name="Drone DockerHub" \ | ||
org.label-schema.vendor="Drone.IO Community" \ | ||
org.label-schema.schema-version="1.0" | ||
|
||
ADD release/linux/i386/drone-dockerhub /bin/ | ||
ENTRYPOINT ["/bin/drone-dockerhub"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# escape=` | ||
FROM microsoft/nanoserver:10.0.14393.1593 | ||
|
||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" ` | ||
org.label-schema.name="Drone DockerHub" ` | ||
org.label-schema.vendor="Drone.IO Community" ` | ||
org.label-schema.schema-version="1.0" | ||
|
||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
ADD release\drone-dockerhub.exe c:\drone-dockerhub.exe | ||
ENTRYPOINT [ "c:\\drone-dockerhub.exe" ] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[[constraint]] | ||
name = "github.com/drone/drone-go" | ||
revision = "eaa41f7836a191224ec5702d2458db07882ec269" | ||
|
||
[[constraint]] | ||
name = "gopkg.in/matryer/try.v1" | ||
version = "1.0.0" | ||
|
||
[prune] | ||
go-tests = true | ||
unused-packages = true |
Oops, something went wrong.