-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (61 loc) · 2.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Go parameters
GO111MODULE=on
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=embgit
BINARY_UNIX=$(BINARY_NAME)_unix
QUIQRAPPDIR=~/cQuiqr/quiqr-desktop
VERSION := $(shell grep version ./src/main.go|head -n1 | tr -d \"|cut -dv -f3)
all: test build
build:
GO111MODULE=$(GO111MODULE) $(GOBUILD) -o $(BINARY_NAME) -v ./src
buildx:
gox -osarch="linux/amd64" -output=embgit ./src
gox -osarch="windows/amd64" -output=embgit ./src
gox -osarch="darwin/amd64" -output=embgit ./src
copy2quiqr:
cp embgit_darwin_amd64 $(QUIQRAPPDIR)/resources/mac/embgit
cp embgit_windows_amd64.exe $(QUIQRAPPDIR)/resources/win/embgit.exe
cp embgit_linux_amd64 $(QUIQRAPPDIR)/resources/linux/embgit
test:
GO111MODULE=$(GO111MODULE) $(GOTEST) -v ./src/...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)*
rm -f $(BINARY_UNIX)
run:
$(GOBUILD) -o $(BINARY_NAME) -v ./src/...
./$(BINARY_NAME)
deps:
$(GOGET) github.com/urfave/cli/v2
release:
ifndef GITHUB_TOKEN
$(error GITHUB_TOKEN is not defined)
endif
git commit -am 'Update version to $(VERSION)'||echo clean
git tag -a $(VERSION) -m '$(VERSION)'
git push origin $(VERSION)
goreleaser --rm-dist
# Cross compilation
#build-linux:
# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_UNIX) -v
#docker-build:
# docker run --rm -it -v "$(GOPATH)":/go -w /go/src/bitbucket.org/rsohlich/makepost golang:latest go build -o "$(BINARY_UNIX)" -v
inttest:
# @rm -Rfv /tmp/test
# ./embgit clone -i ~/.ssh/id_rsa-annemarie-vega [email protected]:servers/scio-site-monitor.git /tmp/test
# @rm -Rfv /tmp/test
# ./embgit clone -i ~/.ssh/id_rsa-annemarie-vega [email protected]:mipmip/linny.vim.git /tmp/test
# @rm -Rfv /tmp/test
@rm -Rfv /tmp/test
./embgit clone -d 3 https://github.com/quiqr/embgit.git /tmp/test
# ./embgit clone -i ~/.ssh/id_rsa-annemarie-vega [email protected]:Sandbox/testembgit.git /tmp/test
# echo ".\n" >> /tmp/test/test
# mkdir /tmp/test/sub
# touch /tmp/test/sub/yoehoe
# ./embgit alladd /tmp/test
# ./embgit commit -n "Pim Snel" -e "[email protected]" -m "a message" /tmp/test
# ./embgit push -i ~/.ssh/id_rsa-annemarie-vega /tmp/test