-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile
43 lines (35 loc) · 1.68 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
.PHONY: all run systemd test docker raspi mac
all:
CGO_ENABLED=0 go install github.com/gokrazy/rsync/cmd/...
run: all
sudo ~/go/bin/gokr-rsyncd -modulemap=default=/etc/default
systemd: all
sudo systemctl stop gokr-rsyncd.socket gokr-rsyncd.service && \
sudo cp /home/michael/go/bin/gokr-rsyncd /usr/bin/ && \
sudo cp systemd/gokr-rsyncd.socket systemd/gokr-rsyncd.service /etc/systemd/system/ && \
sudo systemctl daemon-reload && \
(sudo systemctl kill -f gokr-rsyncd.service; \
sudo systemctl restart gokr-rsyncd.socket)
test:
go test -count=1 -mod=mod -v github.com/gokrazy/rsync/internal/...
go test -mod=mod -c && \
echo unprivileged && ./rsync.test -test.v && \
echo privileged && sudo ./rsync.test -test.v -test.run="TestInterop|TestReceiver"
docker:
CGO_ENABLED=0 GOBIN=$$PWD/docker go install github.com/gokrazy/rsync/cmd/gokr-rsyncd
(cd docker && docker build -t=stapelberg/gokrazy-rsync .)
router7:
GOARCH=amd64 CGO_ENABLED=0 go install github.com/gokrazy/rsync/cmd/gokr-rsyncd && \
(ssh router7.lan killall gokr-rsyncd || true) && \
cp ~/go/bin/gokr-rsyncd /mnt/loop/ && \
ssh router7.lan /perm/gokr-rsyncd -modulemap distri=/perm/srv/repo.distr1.org/distri/ -listen=10.0.0.1:8730 -monitoring_listen=10.0.0.1:8780
raspi:
# -tags nonamespacing
GOARCH=arm64 CGO_ENABLED=0 go install github.com/gokrazy/rsync/cmd/gokr-rsyncd && \
ssh gokrazy.lan killall gokr-rsyncd && \
cp ~/go/bin/linux_arm64/gokr-rsyncd /mnt/loop/ && \
ssh gokrazy.lan /perm/gokr-rsyncd -modulemap pwd=/gokrazy -listen=:873
mac:
GOARCH=arm64 GOOS=darwin CGO_ENABLED=0 go install github.com/gokrazy/rsync/cmd/gokr-rsyncd && \
scp ~/go/bin/darwin_arm64/gokr-rsyncd m1a.lan: && \
ssh m1a.lan ~/gokr-rsyncd -help