forked from JonasFranzDEV/gitea-github-migrator
Merge branch 'master' of ssh://git.jonasfranz.software:10022/JonasFranzDEV/gitea-github-migrator into web-ui
commit
ae9f373e2e
@ -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"] |
@ -0,0 +1,46 @@ |
||||
IMPORT := git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator
|
||||
GO ?= go
|
||||
|
||||
BUILD=$(or ${DRONE_BUILD_NUMBER},${DRONE_BUILD_NUMBER},0)
|
||||
|
||||
ifneq ($(DRONE_TAG),) |
||||
VERSION ?= $(subst v,,$(DRONE_TAG))
|
||||
else |
||||
ifneq ($(DRONE_BRANCH),)
|
||||
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
|
||||
else
|
||||
VERSION ?= master
|
||||
endif
|
||||
endif |
||||
|
||||
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 \
|
||||
$(GO) get -u github.com/mitchellh/gox; \
|
||||
fi
|
||||
gox -ldflags "$(LDFLAGS)" -output "releases/gitea-github-migrator_{{.OS}}_{{.Arch}}"
|
||||
|
||||
.PHONY: lint |
||||
lint: |
||||
@hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
$(GO) get -u golang.org/x/lint/golint; \
|
||||
fi
|
||||
golint -set_exit_status $(go list ./...)
|
||||
|
||||
.PHONY: vet |
||||
vet: |
||||
go vet ./...
|
||||
|
||||
.PHONY: test |
||||
test: lint vet |
||||
go test -cover ./...
|
||||
|
Loading…
Reference in new issue