-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
93 lines (73 loc) · 3.14 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
# Copyright (c) 2017-2024 Alexander Todorov <[email protected]>
#
# Licensed under GNU Affero General Public License v3 or later (AGPLv3+)
# https://www.gnu.org/licenses/agpl-3.0.html
KIWI_VERSION=$(shell python3 setup.py --version)
ENTERPRISE_VERSION=$(KIWI_VERSION)-mt
.PHONY: echo-version
echo-version:
@echo $(ENTERPRISE_VERSION)
.PHONY: build
build:
sudo rm -rf dist/ build/ *.egg-info/
python3 setup.py sdist
python3 setup.py bdist_wheel
twine check dist/*
.PHONY: build-gssapi
build-gssapi:
docker pull registry.access.redhat.com/ubi9-minimal
docker build -t kiwitcms/gssapi-buildroot -f Dockerfile.gssapi .
docker run --rm --security-opt label=disable \
-v `pwd`/dist/:/host kiwitcms/gssapi-buildroot /bin/bash -c 'cp /dist/*.whl /host/'
docker rmi kiwitcms/gssapi-buildroot
.PHONY: build-xmlsec
build-xmlsec:
docker pull quay.io/centos/centos:stream9
docker build -t kiwitcms/xmlsec-buildroot -f Dockerfile.xmlsec .
docker run --rm --security-opt label=disable \
-v `pwd`/dist/:/host kiwitcms/xmlsec-buildroot /bin/bash -c 'cp /dist/*.whl /host/'
docker rmi kiwitcms/xmlsec-buildroot
.PHONY: docker-image
docker-image: build build-gssapi build-xmlsec
# everything else below is Enterprise + multi-tenant
docker build --build-arg KIWI_VERSION=$(KIWI_VERSION) -t quay.io/kiwitcms/enterprise:$(ENTERPRISE_VERSION) .
docker tag quay.io/kiwitcms/enterprise:$(ENTERPRISE_VERSION) quay.io/kiwitcms/enterprise:latest
.PHONY: test-docker-image
test-docker-image: docker-image
./testing/runner.sh
.PHONY: docker-manifest
docker-manifest:
# versioned manifest
docker manifest rm quay.io/kiwitcms/enterprise:$(ENTERPRISE_VERSION) || echo
docker manifest create \
quay.io/kiwitcms/enterprise:$(ENTERPRISE_VERSION) \
quay.io/kiwitcms/enterprise:$(ENTERPRISE_VERSION)-x86_64 \
quay.io/kiwitcms/enterprise:$(ENTERPRISE_VERSION)-aarch64
docker manifest push quay.io/kiwitcms/enterprise:$(ENTERPRISE_VERSION)
# latest manifest
docker manifest rm quay.io/kiwitcms/enterprise:latest || echo
docker manifest create \
quay.io/kiwitcms/enterprise:latest \
quay.io/kiwitcms/enterprise:$(ENTERPRISE_VERSION)-x86_64 \
quay.io/kiwitcms/enterprise:$(ENTERPRISE_VERSION)-aarch64
docker manifest push quay.io/kiwitcms/enterprise:latest
.PHONY: flake8
flake8:
@flake8 --exclude=.git *.py tcms_enterprise tcms_settings_dir
KIWI_LINT_INCLUDE_PATH="../Kiwi"
.PHONY: pylint
pylint:
if [ ! -d "$(KIWI_LINT_INCLUDE_PATH)/kiwi_lint" ]; then \
git clone --depth 1 https://github.com/kiwitcms/Kiwi.git $(KIWI_LINT_INCLUDE_PATH); \
pip install -U -r $(KIWI_LINT_INCLUDE_PATH)/requirements/base.txt; \
pip install -U -r requirements.txt; \
fi
PYTHONPATH=$(KIWI_LINT_INCLUDE_PATH):. \
DJANGO_SETTINGS_MODULE=l10n_settings \
pylint --load-plugins=pylint_django --load-plugins=kiwi_lint \
-d missing-docstring -d duplicate-code -d module-in-directory-without-init -d similar-string \
*.py tcms_enterprise/ tcms_settings_dir/
.PHONY: messages
messages:
./manage.py makemessages --settings l10n_settings --locale en --no-obsolete --ignore "test*.py"
ls tcms_enterprise/locale/*/LC_MESSAGES/*.po | xargs -n 1 -I @ msgattrib -o @ --no-fuzzy @