forked from aquarist-labs/aquarium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (29 loc) · 1.35 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
# The version needs an annotated tag in the git repo in the form vX.Y.Z.
# If such is not present, fall back to using v0.0.0 so we get a non-empty
# version string.
VERSION=$(shell (git describe --match 'v*' --long 2>/dev/null || echo 'v0.0.0') | sed 's/^v//')
usage:
@echo "Try running \`make dist\` to build a tarball"
submodules:
git submodule update --init
glass:
cd src/glass && rm -rf node_modules && npm install && npx ng build --configuration production --output-hashing=all
dist: submodules glass
$(eval TMPDIR := $(shell mktemp -d))
$(eval TAR_BASE := $(TMPDIR)/aquarium-$(VERSION))
$(eval TAR_USR := $(TAR_BASE)/usr/share/aquarium)
$(eval TAR_UNIT := $(TAR_BASE)/usr/lib/systemd/system)
$(eval TAR_SBIN := $(TAR_BASE)/usr/sbin)
mkdir -p $(TAR_USR) $(TAR_UNIT) $(TAR_SBIN)
# Copy gravel, glass, aquarium.py and cephadm from src/...
cd src && \
find gravel -iname '*ceph.git*' -prune -false -o -iname '*.py' | \
xargs cp --parents --target-directory=$(TAR_USR) && \
cp --target-directory=$(TAR_USR) ./aquarium.py && \
cp -R --parents --target-directory=$(TAR_USR) glass/dist && \
cp -R --target-directory=$(TAR_USR) boot && \
cp --target-directory=$(TAR_SBIN) ./gravel/ceph.git/src/cephadm/cephadm
# Copy aquarium service
cp systemd/aquarium.service $(TAR_UNIT)
tar -czf aquarium-$(VERSION).tar.gz -C $(TMPDIR) aquarium-$(VERSION)
rm -r $(TMPDIR)