diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..1f4c07d --- /dev/null +++ b/.drone.yml @@ -0,0 +1,31 @@ +--- +kind: pipeline +name: default + +steps: + - name: fetch + image: docker:git + commands: + - git fetch --tags + + - name: build + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: quay.io/xsteadfastx/govanityurls + registry: quay.io + +services: + - name: docker + image: docker:dind + privileged: true + volumes: + - name: dockersock + path: /var/run + +volumes: + - name: dockersock + temp: {} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..369e583 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:alpine AS build + +WORKDIR /go/src/app +COPY . . + +RUN set -ex \ + && CGO_ENABLED=0 go install -a -ldflags '-w -s -extldflags "-static"' + +FROM scratch + +COPY --from=build /go/bin/govanityurls /govanityurls + +ENTRYPOINT ["/govanityurls"]