aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 71d6571091643406cad9b0be9f1d035202fb13b0 (plain)
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
GUIX_COMMIT ?= 744cf07005745312ccddb549bb1bab5ab7031106
.PHONY: all sync test

all: help

help:
	@echo "Available commands:"

	@echo -en "\tmake matterbridge-$(GUIX_COMMIT).tar.xz"
	@echo -n " # Create a tarball with the matterbridge binary and service"
	@echo " file"

	@echo -en "\tmake matterbridge.toml                                            "
	@echo -n "# Create the matterbridge configuration."
	@echo  " Requires credentials .netrc"

	@echo -en "\tmake sync                                                         "
	@echo -n "# Deploy the matterbridge.tom configuration in the Replicant "
	@echo "server"

	@echo -en "\tmake test                                                         "
	@echo "# Test the matterbridge.toml configuration locally"

matterbridge-$(GUIX_COMMIT).tar.xz:
	rm -f $@
	rm -f matterbridge-$(GUIX_COMMIT).tar
	cp `guix time-machine \
		--commit=$(GUIX_COMMIT) \
		-- \
			pack \
			--save-provenance -RR \
			--compression=xz \
			matterbridge \
			--symlink=/usr/bin/matterbridge=bin/matterbridge` $@
	unxz $@
	chmod +w matterbridge-$(GUIX_COMMIT).tar
	tar -rf matterbridge-$(GUIX_COMMIT).tar \
		matterbridge.service \
		--transform='s/^/.\/etc\/systemd\/system\//'
	xz -9e -T 2 --verbose matterbridge-$(GUIX_COMMIT).tar

matterbridge.toml: matterbridge.toml.example generate-matterbridge-config.py
	./generate-matterbridge-config.py

sync: matterbridge.toml
	rsync matterbridge.toml root@git.replicant.us:/etc/

test: matterbridge.toml
	matterbridge -conf matterbridge.toml