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.

Makefile 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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: build
  16. build:
  17. go build -ldflags "$(LDFLAGS)" -o gitea-github-migrator
  18. .PHONY: build-binary-web
  19. build-binary-web:
  20. go build -ldflags "$(LDFLAGS)" -tags web -o gitea-github-migrator
  21. .PHONY: build-web
  22. build-web: packr build-binary-web packr-clean
  23. .PHONY: packr
  24. packr:
  25. @hash packr > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  26. $(GO) get -u github.com/gobuffalo/packr/...; \
  27. fi
  28. packr -z
  29. .PHONY: packr-clean
  30. packr-clean:
  31. @hash packr > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  32. $(GO) get -u github.com/gobuffalo/packr/...; \
  33. fi
  34. packr clean
  35. .PHONY: clean
  36. clean: packr-clean
  37. go clean ./...
  38. .PHONY: docker-binary
  39. docker-binary: build
  40. .PHONY: docker-binary-web
  41. docker-binary-web: build-web
  42. .PHONY: generate-release-file
  43. generate-release-file:
  44. echo $(VERSION) > .version
  45. .PHONY: release
  46. release: packr release-builds packr-clean
  47. .PHONY: release-builds
  48. release-builds:
  49. @hash gox > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  50. $(GO) get -u github.com/mitchellh/gox; \
  51. fi
  52. gox -ldflags "$(LDFLAGS)" -tags web -output "releases/gitea-github-migrator_{{.OS}}_{{.Arch}}"
  53. .PHONY: lint
  54. lint:
  55. @hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  56. $(GO) get -u golang.org/x/lint/golint; \
  57. fi
  58. golint -set_exit_status $(go list ./...)
  59. .PHONY: ineffassign
  60. ineffassign:
  61. @hash ineffassign > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  62. $(GO) get -u github.com/gordonklaus/ineffassign; \
  63. fi
  64. ineffassign .
  65. .PHONY: vet
  66. vet:
  67. go vet ./...
  68. .PHONY: test
  69. test: lint vet ineffassign
  70. go test -tags web -cover ./...
  71. .PHONY: coverage
  72. coverage:
  73. @hash goveralls > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  74. $(GO) get -u github.com/mattn/goveralls; \
  75. fi
  76. goveralls -service=drone.io -endpoint=https://coverage.jonasfranz.software