-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
64 lines (49 loc) · 1.8 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
#!/usr/bin/make
tagname = 10.4-5.1.9
tagname_rc = 10.4-5.1.6rc
tagname_ng = bullseye-5.99-20210427
docker_user = setsoft
docker_img = setsoft/kicad_auto
CWD := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))
USER_ID=$(shell id -u)
GROUP_ID=$(shell id -g)
build:
docker build --no-cache -f Dockerfile -t $(docker_img):$(tagname) .
docker build -f Dockerfile -t $(docker_img):latest .
build_rc:
docker build -f Dockerfile -t $(docker_img):$(tagname_rc) .
build_ng:
docker build -f nightly/Dockerfile -t $(docker_img):$(tagname_ng) .
docker build -f nightly/Dockerfile -t $(docker_img):nightly .
upload_image:
#docker login --username=$(docker_user)
docker push $(docker_img):$(tagname)
docker push $(docker_img):latest
upload_image_rc:
docker push $(docker_img):$(tagname_rc)
upload_image_ng:
docker push $(docker_img):$(tagname_ng)
docker push $(docker_img):nightly
release: build upload_image
release_rc: build_rc upload_image_rc
release_ng: build_ng upload_image_ng
# If docker is not installed in the host system
install_docker:
sudo apt install docker.io
sudo systemctl enable --now docker
sudo usermod -aG docker $(USER)
clean:
@ rm -rf *.deb
# Docker shell for the current user.
# You can access the desktop and your home.
# Changes to the docker image are discarded, but changes to your home are real changes.
docker_shell:
docker run -it --rm -v $(CWD):$(CWD) --workdir="$(CWD)" \
-v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$(DISPLAY) \
--user $(USER_ID):$(GROUP_ID) \
--volume="/etc/group:/etc/group:ro" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/home/$(USER):/home/$(USER):rw" \
$(docker_img):$(tagname) /bin/bash
.PHONY: build_release upload_image upload_image_rc install_docker clean build build_rc release release_rc