Skip to content

Commit

Permalink
Restructuring of build process
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Aug 28, 2017
1 parent 7f3e615 commit cb00803
Show file tree
Hide file tree
Showing 15 changed files with 164 additions and 236 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!release/
99 changes: 81 additions & 18 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,96 @@
workspace:
path: src/github.com/drone-plugins/drone-s3-sync
base: /go
path: src/github.com/drone-plugins/drone-s3-sync

pipeline:
test:
image: golang:1.6
environment:
- CGO_ENABLED=0
image: golang:1.9
commands:
- go vet
- go test -cover -coverprofile=coverage.out
- go build -ldflags "-s -w -X main.build=$DRONE_BUILD_NUMBER" -a -tags netgo

publish:
build_linux_amd64:
image: golang:1.9
group: build
environment:
- GOOS=linux
- GOARCH=amd64
- CGO_ENABLED=0
commands:
- go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/amd64/drone-s3-sync

build_linux_arm64:
image: golang:1.9
group: build
environment:
- GOOS=linux
- GOARCH=arm64
- CGO_ENABLED=0
commands:
- go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/arm64/drone-s3-sync

build_linux_arm:
image: golang:1.9
group: build
environment:
- GOOS=linux
- GOARCH=arm
- CGO_ENABLED=0
- GOARM=7
commands:
- go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/arm/drone-s3-sync

# build_windows_amd64:
# image: golang:1.9-nanoserver
# group: build
# environment:
# - GOOS=windows
# - GOARCH=amd64
# - CGO_ENABLED=0
# commands:
# - go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/windows/amd64/drone-s3-sync

publish_linux_amd64:
image: plugins/docker
repo: plugins/s3-sync
tags: [ latest, 1.1.0, 1.1, 1 ]
secrets: [ docker_username, docker_password ]
when:
branch: master
event: push

publish_linux_arm64:
image: plugins/docker
repo: plugins/s3-sync
tags: [ "latest", "1.1", "1" ]
tags: [ linux-arm64 ]
secrets: [ docker_username, docker_password ]
dockerfile: Dockerfile.arm64
when:
branch: master
event: push

plugin:
name: S3 Sync
desc: Sync a directory with an Amazon S3 Bucket
type: publish
image: plugins/s3-sync
labels:
- publish
- artifacts
- amazon
- aws
- s3
publish_linux_arm:
image: plugins/docker
repo: plugins/s3-sync
tags: [ linux-arm ]
secrets: [ docker_username, docker_password ]
dockerfile: Dockerfile.arm
when:
branch: master
event: push

# publish_windows_amd64:
# image: plugins/docker
# repo: plugins/s3-sync
# tags: [ windows-amd64 ]
# secrets: [ docker_username, docker_password ]
# dockerfile: Dockerfile.windows
# when:
# branch: master
# event: push

# microbadger:
# image: plugins/webhook
# secrets: [ webhook_url ]
# when:
# status: [ success ]
1 change: 0 additions & 1 deletion .drone.yml.sig

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ _testmain.go
*.prof
.env

release/*
coverage.out
drone-s3-sync
drone-s3-sync
119 changes: 0 additions & 119 deletions DOCS.md

This file was deleted.

25 changes: 17 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
FROM alpine:3.4
FROM alpine:3.6 as alpine
RUN apk add -U --no-cache ca-certificates mailcap

RUN apk update && \
apk add \
ca-certificates \
mailcap && \
rm -rf /var/cache/apk/*
FROM scratch
MAINTAINER Drone.IO Community <[email protected]>

ADD drone-s3-sync /bin/
ENTRYPOINT ["/bin/drone-s3-sync"]
ENV GODEBUG=netdns=go

COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=alpine /etc/mime.types /etc/

LABEL org.label-schema.version=latest
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-s3-sync.git"
LABEL org.label-schema.name="Drone S3 Sync"
LABEL org.label-schema.vendor="Drone.IO Community"
LABEL org.label-schema.schema-version="1.0"

ADD release/linux/amd64/drone-s3-sync /bin/
ENTRYPOINT [ "/bin/drone-s3-sync" ]
19 changes: 19 additions & 0 deletions Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM alpine:3.6 as alpine
RUN apk add -U --no-cache ca-certificates mailcap

FROM scratch
MAINTAINER Drone.IO Community <[email protected]>

ENV GODEBUG=netdns=go

COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=alpine /etc/mime.types /etc/

LABEL org.label-schema.version=latest
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-s3-sync.git"
LABEL org.label-schema.name="Drone S3 Sync"
LABEL org.label-schema.vendor="Drone.IO Community"
LABEL org.label-schema.schema-version="1.0"

ADD release/linux/arm/drone-s3-sync /bin/
ENTRYPOINT [ "/bin/drone-s3-sync" ]
19 changes: 19 additions & 0 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM alpine:3.6 as alpine
RUN apk add -U --no-cache ca-certificates mailcap

FROM scratch
MAINTAINER Drone.IO Community <[email protected]>

ENV GODEBUG=netdns=go

COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=alpine /etc/mime.types /etc/

LABEL org.label-schema.version=latest
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-s3-sync.git"
LABEL org.label-schema.name="Drone S3 Sync"
LABEL org.label-schema.vendor="Drone.IO Community"
LABEL org.label-schema.schema-version="1.0"

ADD release/linux/arm64/drone-s3-sync /bin/
ENTRYPOINT [ "/bin/drone-s3-sync" ]
10 changes: 0 additions & 10 deletions Dockerfile.armhf

This file was deleted.

13 changes: 13 additions & 0 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM microsoft/nanoserver:latest
MAINTAINER Drone.IO Community <[email protected]>

ENV GODEBUG=netdns=go

LABEL org.label-schema.version=latest
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-s3-sync.git"
LABEL org.label-schema.name="Drone S3 Sync"
LABEL org.label-schema.vendor="Drone.IO Community"
LABEL org.label-schema.schema-version="1.0"

ADD release/windows/amd64/drone-s3-sync /bin/
ENTRYPOINT [ "/bin/drone-s3-sync" ]
46 changes: 0 additions & 46 deletions MAINTAINERS

This file was deleted.

Loading

0 comments on commit cb00803

Please sign in to comment.