From 1017553f08a23a5707618258856db68071e5c2a0 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sun, 2 Jun 2019 16:52:51 -0400 Subject: [PATCH] Updated build environment for drone --- .drone.yml | 65 +++++++++++++++++++++++++++++ docker/Dockerfile.arm => Dockerfile | 9 ++-- docker/Dockerfile | 13 ------ docker/Dockerfile.arm64 | 15 ------- manifest.yml | 10 ++--- 5 files changed, 74 insertions(+), 38 deletions(-) create mode 100644 .drone.yml rename docker/Dockerfile.arm => Dockerfile (58%) delete mode 100644 docker/Dockerfile delete mode 100644 docker/Dockerfile.arm64 diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..cbedf7e --- /dev/null +++ b/.drone.yml @@ -0,0 +1,65 @@ +kind: pipeline +name: amd64 + +platform: + os: linux + arch: amd64 + +steps: + - name: docker + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: registry.meow.tf/joker/godns + registry: registry.meow.tf + tags: + - amd64-latest + +--- +kind: pipeline +name: arm64 + +platform: + os: linux + arch: arm64 + +steps: + - name: docker + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: registry.meow.tf/joker/godns + registry: registry.meow.tf + tags: + - arm64-latest + +--- +kind: pipeline +name: manifest + +steps: + - name: manifest + image: registry.meow.tf/docker/tools/manifest-tool:amd64-latest + environment: + DOCKER_USERNAME: + from_secret: docker_username + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_REGISTRY: + from_secret: docker_registry + commands: + - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY + - /usr/bin/manifest-tool push from-spec manifest.yml + +depends_on: + - amd64 + - arm64 + +image_pull_secrets: + - dockerconfigjson \ No newline at end of file diff --git a/docker/Dockerfile.arm b/Dockerfile similarity index 58% rename from docker/Dockerfile.arm rename to Dockerfile index 317889a..8329ebd 100644 --- a/docker/Dockerfile.arm +++ b/Dockerfile @@ -1,6 +1,9 @@ -FROM arm32v6/alpine +FROM golang:alpine AS build-env -COPY tmp/qemu-arm-static /usr/bin/qemu-arm-static +ADD . /src +RUN cd /src && go get -d && go build -o godns + +FROM alpine MAINTAINER Tyler Stuyfzand @@ -11,5 +14,5 @@ ENTRYPOINT ["/sbin/tini", "-g", "--"] CMD ["godns"] COPY etc/godns.example.conf /etc/godns.conf -COPY godns-arm /usr/local/bin/godns +COPY --from=build-env /src/godns /usr/local/bin/godns RUN chmod +x /usr/local/bin/godns diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 1ee7b79..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM alpine:3.7 - -MAINTAINER Tyler Stuyfzand - -EXPOSE 53 - -RUN apk --no-cache add tini -ENTRYPOINT ["/sbin/tini", "-g", "--"] -CMD ["godns"] - -COPY etc/godns.example.conf /etc/godns.conf -COPY godns /usr/local/bin/godns -RUN chmod +x /usr/local/bin/godns diff --git a/docker/Dockerfile.arm64 b/docker/Dockerfile.arm64 deleted file mode 100644 index df66cd6..0000000 --- a/docker/Dockerfile.arm64 +++ /dev/null @@ -1,15 +0,0 @@ -FROM arm64v8/alpine - -COPY tmp/qemu-aarch64-static /usr/bin/qemu-aarch64-static - -MAINTAINER Tyler Stuyfzand - -EXPOSE 53 - -RUN apk --no-cache add tini -ENTRYPOINT ["/sbin/tini", "-g", "--"] -CMD ["godns"] - -COPY etc/godns.example.conf /etc/godns.conf -COPY godns-arm64 /usr/local/bin/godns -RUN chmod +x /usr/local/bin/godns diff --git a/manifest.yml b/manifest.yml index a20577f..9055e49 100644 --- a/manifest.yml +++ b/manifest.yml @@ -1,14 +1,10 @@ -image: registry.git.meow.tf/tyler/godns:latest +image: registry.git.meow.tf/joker/godns:latest manifests: -- image: registry.git.meow.tf/tyler/godns:amd64-latest +- image: registry.git.meow.tf/joker/godns:amd64-latest platform: architecture: amd64 os: linux -- image: registry.git.meow.tf/tyler/godns:arm-latest - platform: - architecture: arm - os: linux -- image: registry.git.meow.tf/tyler/godns:arm64-latest +- image: registry.git.meow.tf/joker/godns:arm64-latest platform: architecture: arm64 os: linux \ No newline at end of file