Skip to content

Commit 7292ca8

Browse files
committed
updated Makefile
Signed-off-by: Alexander Piskun <[email protected]>
1 parent 1ccf0df commit 7292ca8

File tree

1 file changed

+42
-28
lines changed

1 file changed

+42
-28
lines changed

Makefile

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,78 @@
11
.DEFAULT_GOAL := help
22

3+
APP_ID := visionatrix
4+
APP_NAME := Visionatrix
5+
APP_VERSION := $$(xmlstarlet sel -t -v "//image-tag" appinfo/info.xml)
6+
JSON_INFO := "{\"id\":\"$(APP_ID)\",\"name\":\"$(APP_NAME)\",\"daemon_config_name\":\"manual_install\",\"version\":\"$(APP_VERSION)\",\"secret\":\"12345\",\"port\":9100, \"routes\": [{\"url\":\".*\",\"verb\":\"GET, POST, PUT, DELETE\",\"access_level\":1,\"headers_to_exclude\":[]}], \"translations_folder\":\"\/tmp\/vix_l10n\"}"
7+
8+
39
.PHONY: help
410
help:
5-
@echo "Welcome to Nextcloud Visionatrix. Please use \`make <target>\` where <target> is one of"
11+
@echo " Welcome to $(APP_NAME) $(APP_VERSION)!"
12+
@echo " "
13+
@echo " Please use \`make <target>\` where <target> is one of"
14+
@echo " "
15+
@echo " build-push build CPU images and upload to ghcr.io"
16+
@echo " build-push-cuda build CUDA image and upload to ghcr.io"
17+
@echo " build-push-rocm build ROCM image and upload to ghcr.io"
18+
@echo " "
19+
@echo " > Next commands are only for the dev environment with nextcloud-docker-dev!"
20+
@echo " > They should run from the host you are developing on(with activated venv) and not in the container with Nextcloud!"
21+
@echo " "
22+
@echo " run30 install $(APP_NAME) for Nextcloud 30"
23+
@echo " run install $(APP_NAME) for Nextcloud Latest"
24+
@echo " "
25+
@echo " > Commands for manual registering of ExApp($(APP_NAME) should be running!):"
26+
@echo " "
27+
@echo " register30 perform registration of running $(APP_NAME) into the 'manual_install' deploy daemon."
28+
@echo " register perform registration of running $(APP_NAME) into the 'manual_install' deploy daemon."
629
@echo " "
7-
@echo " Next commands are only for dev environment with nextcloud-docker-dev!"
8-
@echo " They should run from the host you are developing on(with activated venv) and not in the container with Nextcloud!"
9-
@echo " "
10-
@echo " build-push build image and upload to ghcr.io"
11-
@echo " "
12-
@echo " run install Visionatrix for Nextcloud Last"
13-
@echo " "
14-
@echo " For development of this example use PyCharm run configurations. Development is always set for last Nextcloud."
15-
@echo " First run original 'Visionatrix', then run this Visionatrix and then 'make registerXX', after that you can use/debug/develop it and easy test."
16-
@echo " Do not forget to change paths in 'proxy_requests' function to point to correct files for the frontend"
17-
@echo " "
18-
@echo " register perform registration of running Visionatrix-es into the 'manual_install' deploy daemon."
19-
@echo " "
2030
@echo " L10N (for manual translation):"
2131
@echo " translation_templates extract translation strings from sources"
2232
@echo " convert_translations_nc convert translations to Nextcloud format files (json, js)"
23-
@echo " convert_to_locale copy translations to the common locale/<lang>/LC_MESSAGES/<appid>.(po|mo)"
33+
@echo " convert_to_locale copy translations to the common locale/<lang>/LC_MESSAGES/<appid>.(po|mo)"
2434

2535
.PHONY: build-push-cpu
2636
build-push-cpu:
2737
npm ci && npm run build
2838
docker login ghcr.io
29-
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/visionatrix:$$(xmlstarlet sel -t -v "//image-tag" appinfo/info.xml) --build-arg BUILD_TYPE=cpu .
39+
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/$(APP_ID):$(APP_VERSION) --build-arg BUILD_TYPE=cpu .
3040

3141
.PHONY: build-push-cuda
3242
build-push-cuda:
3343
npm ci && npm run build
3444
docker login ghcr.io
35-
docker buildx build --push --platform linux/amd64 --tag ghcr.io/cloud-py-api/visionatrix:$$(xmlstarlet sel -t -v "//image-tag" appinfo/info.xml)-cuda --build-arg BUILD_TYPE=cuda .
45+
docker buildx build --push --platform linux/amd64 --tag ghcr.io/cloud-py-api/$(APP_ID):$(APP_VERSION)-cuda --build-arg BUILD_TYPE=cuda .
3646

3747
.PHONY: build-push-rocm
3848
build-push-rocm:
3949
npm ci && npm run build
4050
docker login ghcr.io
41-
docker buildx build --push --platform linux/amd64 --tag ghcr.io/cloud-py-api/visionatrix:$$(xmlstarlet sel -t -v "//image-tag" appinfo/info.xml)-rocm --build-arg BUILD_TYPE=rocm .
51+
docker buildx build --push --platform linux/amd64 --tag ghcr.io/cloud-py-api/$(APP_ID):$(APP_VERSION)-rocm --build-arg BUILD_TYPE=rocm .
4252

4353
.PHONY: run30
4454
run30:
45-
docker exec master-stable30-1 sudo -u www-data php occ app_api:app:unregister visionatrix --silent --force || true
46-
docker exec master-stable30-1 sudo -u www-data php occ app_api:app:register visionatrix \
47-
--info-xml https://raw.githubusercontent.com/cloud-py-api/visionatrix/main/appinfo/info.xml
55+
docker exec master-stable30-1 sudo -u www-data php occ app_api:app:unregister $(APP_ID) --silent --force || true
56+
docker exec master-stable30-1 sudo -u www-data php occ app_api:app:register $(APP_ID) \
57+
--info-xml https://raw.githubusercontent.com/cloud-py-api/$(APP_ID)/main/appinfo/info.xml
4858

4959
.PHONY: run
5060
run:
51-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister visionatrix --silent --force || true
52-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register visionatrix \
53-
--info-xml https://raw.githubusercontent.com/cloud-py-api/visionatrix/main/appinfo/info.xml
61+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister $(APP_ID) --silent --force || true
62+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register $(APP_ID) \
63+
--info-xml https://raw.githubusercontent.com/cloud-py-api/$(APP_ID)/main/appinfo/info.xml
64+
65+
.PHONY: register30
66+
register30:
67+
docker exec master-stable30-1 sudo -u www-data php occ app_api:app:unregister $(APP_ID) --silent --force || true
68+
docker exec master-stable30-1 rm -rf /tmp/vix_l10n && docker cp ex_app/l10n master-stable30-1:/tmp/vix_l10n
69+
docker exec master-stable30-1 sudo -u www-data php occ app_api:app:register $(APP_ID) manual_install --json-info $(JSON_INFO) --wait-finish
5470

5571
.PHONY: register
5672
register:
57-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister visionatrix --silent --force || true
73+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister $(APP_ID) --silent --force || true
5874
docker exec master-nextcloud-1 rm -rf /tmp/vix_l10n && docker cp ex_app/l10n master-nextcloud-1:/tmp/vix_l10n
59-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register visionatrix manual_install --json-info \
60-
"{\"id\":\"visionatrix\",\"name\":\"Visionatrix\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9100,\"scopes\":[\"ALL\"], \"routes\": [{\"url\":\".*\",\"verb\":\"GET, POST, PUT, DELETE\",\"access_level\":1,\"headers_to_exclude\":[]}], \"translations_folder\":\"\/tmp\/vix_l10n\"}" \
61-
--wait-finish
75+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register $(APP_ID) manual_install --json-info $(JSON_INFO) --wait-finish
6276

6377
.PHONY: translation_templates
6478
translation_templates:

0 commit comments

Comments
 (0)