-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (43 loc) · 1.23 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
REPO=alpin3
NAME=ulx3s-core
IMAGE=$(REPO)/$(NAME)
OSTYPE=$(shell uname -s | tr '[A-Z]' '[a-z]')
MACHINE=$(shell uname -m)
ARCH=$(OSTYPE)-$(MACHINE)
VERSION=$(shell date '+%Y.%m.%d')
ver:
echo $(IMAGE) version $(VERSION)
build:
docker build -t $(IMAGE):v$(VERSION) .
push:
docker push $(IMAGE):v$(VERSION)
pull:
docker pull $(IMAGE):v$(VERSION)
latest:
docker tag $(IMAGE):v$(VERSION) $(IMAGE):latest
pushlatest:
docker push $(IMAGE):latest
gittag:
git tag v$(VERSION)
pushtags:
git push --tags origin master
gitappimage:
git clone https://github.com/kost/ulx3s-appimage
bins:
mkdir -p dist work
docker run -it --name $(NAME)-$(VERSION) $(IMAGE):v$(VERSION) true
docker cp $(NAME)-$(VERSION):/usr/local/bin work/$(NAME)-$(VERSION)-$(ARCH)
rm -f dist/$(NAME)-$(VERSION)-$(ARCH).tar.gz
tar -cvz -C work --owner root --group root -f dist/$(NAME)-$(VERSION)-$(ARCH).tar.gz $(NAME)-$(VERSION)-$(ARCH)
docker rm $(NAME)-$(VERSION)
rm -rf work/$(NAME)-$(VERSION)-$(ARCH)
cpbins:
docker run -it --name $(NAME)-$(VERSION) $(IMAGE):v$(VERSION) true
docker cp $(NAME)-$(VERSION):/usr/local/bin $(NAME)-$(VERSION)-$(ARCH)
docker rm $(NAME)-$(VERSION)
clean:
rm -rf dist work
rel:
ghr v$(VERSION) dist/
draft:
ghr -draft v$(VERSION) dist/