A tool to migrate GitHub Repositories to Gitea including all issues
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

49 lines
992 B

  1. IMPORT := git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator
  2. GO ?= go
  3. ifneq ($(DRONE_TAG),)
  4. VERSION ?= $(subst v,,$(DRONE_TAG))
  5. else
  6. ifneq ($(DRONE_BRANCH),)
  7. VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
  8. else
  9. VERSION ?= master
  10. endif
  11. endif
  12. LDFLAGS := -X main.version=$(VERSION) -X main.build=$(DRONE_BUILD_NUMBER)
  13. .PHONY: all
  14. all:
  15. .PHONY: docker-binary
  16. docker-binary:
  17. go build -ldflags "$(LDFLAGS)" -o gitea-github-migrator
  18. .PHONY: generate-release-file
  19. generate-release-file:
  20. echo $(VERSION) > .version
  21. .PHONY: release
  22. release:
  23. @hash gox > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  24. $(GO) get -u github.com/mitchellh/gox; \
  25. fi
  26. gox -ldflags "$(LDFLAGS)" -output "releases/gitea-github-migrator_{{.OS}}_{{.Arch}}"
  27. .PHONY: lint
  28. lint:
  29. @hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  30. $(GO) get -u golang.org/x/lint/golint; \
  31. fi
  32. golint -set_exit_status $(go list ./...)
  33. .PHONY: vet
  34. vet:
  35. go vet ./...
  36. .PHONY: test
  37. test: lint vet
  38. go test -cover ./...