forked from nextcloud/app_api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
131 lines (115 loc) · 6.91 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
.DEFAULT_GOAL := help
.PHONY: docs
.PHONY: html
docs html:
$(MAKE) -C docs html
.PHONY: help
help:
@echo "Welcome to AppEcosystemV2 development. Please use \`make <target>\` where <target> is one of"
@echo " docs make HTML docs"
@echo " html make HTML docs"
@echo " "
@echo " "
@echo " Next commands are only for dev environment with nextcloud-docker-dev!"
@echo " Daemon register(Linux, socket):"
@echo " dock-sock create docker daemon for Nextcloud 28, 27, 26 (/var/run/docker.sock)"
@echo " dock-sock28 create docker daemon for Nextcloud 28 (/var/run/docker.sock)"
@echo " dock-sock27 create docker daemon for Nextcloud 27 (/var/run/docker.sock)"
@echo " dock-sock26 create docker daemon for Nextcloud 26 (/var/run/docker.sock)"
@echo " "
@echo " Daemon register(any OS, host:port)"
@echo " dock2port will map docker socket to port. first use this!"
@echo " dock-certs deploy certs, second use this!"
@echo " dock-port create docker daemons for Nextcloud 28, 27, 26 (host.docker.internal:8443)"
@echo " dock-port28 create docker daemon for Nextcloud 28 (host.docker.internal:8443)"
@echo " dock-port27 create docker daemon for Nextcloud 27 (host.docker.internal:8443)"
@echo " dock-port26 create docker daemon for Nextcloud 26 (host.docker.internal:8443)"
@echo " "
@echo " "
@echo " example-deploy deploy Example App to docker"
@echo " example28 register & enable Example App in Nextcloud 28"
@echo " example27 register & enable Example App in Nextcloud 27"
@echo " example26 register & enable Example App in Nextcloud 26"
.PHONY: dock-sock
dock-sock:
$(MAKE) dock-sock28 dock-sock27 dock-sock26
.PHONY: dock-sock28
dock-sock28:
@echo "creating daemon for nextcloud 'master' container"
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:daemon:unregister docker_dev || true
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:daemon:register \
docker_dev Docker docker-install unix-socket /var/run/docker.sock http://nextcloud/index.php --net=master_default
.PHONY: dock-sock27
dock-sock27:
@echo "creating daemon for nextcloud 'stable27' container"
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:daemon:unregister docker_dev || true
docker exec master-stable27-1 sudo -u www-data php occ app_ecosystem_v2:daemon:register \
docker_dev Docker docker-install unix-socket /var/run/docker.sock http://stable27/index.php --net=master_default
.PHONY: dock-sock26
dock-sock26:
@echo "creating daemon for nextcloud 'stable26' container"
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:daemon:unregister docker_dev || true
docker exec master-stable6-1 sudo -u www-data php occ app_ecosystem_v2:daemon:register \
docker_dev Docker docker-install unix-socket /var/run/docker.sock http://stable26/index.php --net=master_default
.PHONY: dock2port
dock2port:
@echo "deploying kekru/docker-remote-api-tls..."
docker run --name dock_api2port -d -p 6443:443 -v /var/run/docker.sock:/var/run/docker.sock:ro \
--env CREATE_CERTS_WITH_PW=supersecret --env CERT_HOSTNAME=host.docker.internal \
-v `pwd`/certs:/data/certs kekru/docker-remote-api-tls:master
@echo "waiting 20 seconds to finish generating certificates..."
sleep 20
.PHONE: dock-certs
dock-certs:
@echo "copying certs to Nextcloud Master"
docker cp ./certs/client/ master-nextcloud-1:/ || echo "Failed copying certs to Nextcloud 'master'"
docker exec master-nextcloud-1 sudo -u www-data php occ security:certificates:import /client/ca.pem || true
@echo "copying certs to Nextcloud 27"
docker cp ./certs/client/ master-stable27-1:/ || echo "Failed copying certs to Nextcloud 27"
docker exec master-stable27-1 sudo -u www-data php occ security:certificates:import /client/ca.pem || true
@echo "copying certs to Nextcloud 26"
docker cp ./certs/client/ master-stable26-1:/ || echo "Failed copying certs to Nextcloud 26"
docker exec master-stable26-1 sudo -u www-data php occ security:certificates:import /client/ca.pem || true
.PHONY: dock-port
dock-port:
$(MAKE) dock-port28 dock-port27 dock-port26
.PHONY: dock-port28
dock-port28:
@echo "creating daemon for nextcloud 'master' container"
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:daemon:unregister docker_dev || true
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:daemon:register \
docker_dev Docker docker-install https host.docker.internal:6443 http://nextcloud/index.php \
--net=master_default --ssl_cert /client/cert.pem --ssl_key /client/key.pem
.PHONY: dock-port27
dock-port27:
@echo "creating daemon for nextcloud '27' container"
docker exec master-stable27-1 sudo -u www-data php occ app_ecosystem_v2:daemon:unregister docker_dev || true
docker exec master-stable27-1 sudo -u www-data php occ app_ecosystem_v2:daemon:register \
docker_dev Docker docker-install https host.docker.internal:6443 http://stable27/index.php \
--net=master_default --ssl_cert /client/cert.pem --ssl_key /client/key.pem
.PHONY: dock-port26
dock-port26:
@echo "creating daemon for nextcloud '26' container"
docker exec master-stable26-1 sudo -u www-data php occ app_ecosystem_v2:daemon:unregister docker_dev || true
docker exec master-stable26-1 sudo -u www-data php occ app_ecosystem_v2:daemon:register \
docker_dev Docker docker-install https host.docker.internal:6443 http://stable26/index.php \
--net=master_default --ssl_cert /client/cert.pem --ssl_key /client/key.pem
.PHONY: example-deploy
example-deploy:
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:app:deploy app_python_skeleton docker_dev \
--info-xml https://raw.githubusercontent.com/cloud-py-api/py_app_v2-skeleton/main/appinfo/info.xml
.PHONY: example28
example28:
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:app:unregister app_python_skeleton --silent || true
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:app:register app_python_skeleton docker_dev
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:app:enable app_python_skeleton
.PHONY: example27
example27:
docker exec master-stable27-1 sudo -u www-data php occ app_ecosystem_v2:app:unregister app_python_skeleton --silent || true
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:app:register app_python_skeleton docker_dev
docker exec master-stable27-1 sudo -u www-data php occ app_ecosystem_v2:app:enable app_python_skeleton
.PHONY: example26
example26:
docker exec master-stable26-1 sudo -u www-data php occ app_ecosystem_v2:app:unregister app_python_skeleton --silent || true
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:app:register app_python_skeleton docker_dev
docker exec master-stable26-1 sudo -u www-data php occ app_ecosystem_v2:app:enable app_python_skeleton