diff --git a/.drone.yml b/.drone.yml index 12fc0dc..f0e8fed 100644 --- a/.drone.yml +++ b/.drone.yml @@ -44,4 +44,12 @@ pipeline: - sha256 - md5 when: - event: [ tag ] \ No newline at end of file + event: [ tag ] + docker: + image: plugins/docker:17.12 + secrets: [ docker_username, docker_password ] + pull: true + repo: jonasfranz/gitea-github-migrator + default_tags: true + when: + event: [ push, tag ] diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..75344ba --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +#Build stage +FROM golang:1.10-alpine3.7 AS build-env + +#Build deps +RUN apk --no-cache add build-base git + +#Setup repo +COPY . ${GOPATH}/src/git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator +WORKDIR ${GOPATH}/src/git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator + +RUN make docker-binary + +FROM alpine:3.7 +LABEL maintainer="info@jonasfranz.software" + +COPY --from=build-env /go/src/git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator/gitea-github-migrator /usr/local/bin/gitea-github-migrator + +ENTRYPOINT ["/usr/local/bin/gitea-github-migrator"] diff --git a/Makefile b/Makefile index 0c1ff02..e4d5b86 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,10 @@ LDFLAGS := -X main.Version=$(VERSION) -X main.build=$(BUILD) .PHONY: all all: +.PHONY: docker-binary +docker-binary: + go build -ldflags "$(LDFLAGS)" -o gitea-github-migrator + .PHONY: release release: @hash gox > /dev/null 2>&1; if [ $$? -ne 0 ]; then \