-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
93 lines (84 loc) · 3.12 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
buildroot = /
python_version = 3
python_lookup_name = python$(python_version)
python = $(shell which $(python_lookup_name))
sc_disable = SC1091,SC1090,SC2001,SC2174,SC1117
version := $(shell \
$(python) -c \
'from suse_migration_services.version import __VERSION__; print(__VERSION__)'\
)
tar: clean check test
# build the sdist source tarball
poetry build --format=sdist
build: tar
# provide rpm source tarball
mv dist/suse_migration_services-${version}.tar.gz \
dist/suse-migration-services.tar.gz
# update rpm changelog using reference file
helper/update_changelog.py \
--since package/suse-migration-services.changes.ref --utc > \
dist/suse-migration-services.changes
helper/update_changelog.py \
--file package/suse-migration-services.changes --utc >> \
dist/suse-migration-services.changes
# update package version in spec file
cat package/suse-migration-services-spec-template \
| sed -e s'@%%VERSION@${version}@' \
> dist/suse-migration-services.spec
# provide rpm rpmlintrc
cp package/suse-migration-services-rpmlintrc dist
sle15_activation: tar
# provide rpm source tarball
mv dist/suse_migration_services-*.tar.gz \
dist/suse-migration-sle15-activation.tar.gz
# update rpm changelog using reference file
helper/update_changelog.py \
--since package/suse-migration-sle15-activation.changes.ref \
--from package/suse-migration-sle15-activation-spec-template \
--from grub.d --utc > \
dist/suse-migration-sle15-activation.changes
helper/update_changelog.py \
--file package/suse-migration-sle15-activation.changes --utc >> \
dist/suse-migration-sle15-activation.changes
# update package version in spec file
cat package/suse-migration-sle15-activation-spec-template \
| sed -e s'@%%VERSION@${version}@' \
> dist/suse-migration-sle15-activation.spec
sle16_activation: tar
# provide rpm source tarball
mv dist/suse_migration_services-*.tar.gz \
dist/suse-migration-sle16-activation.tar.gz
# update rpm changelog using reference file
helper/update_changelog.py \
--since package/suse-migration-sle16-activation.changes.ref \
--from package/suse-migration-sle16-activation-spec-template \
--from grub.d --utc > \
dist/suse-migration-sle16-activation.changes
helper/update_changelog.py \
--file package/suse-migration-sle16-activation.changes --utc >> \
dist/suse-migration-sle16-activation.changes
# update package version in spec file
cat package/suse-migration-sle16-activation-spec-template \
| sed -e s'@%%VERSION@${version}@' \
> dist/suse-migration-sle16-activation.spec
setup:
poetry install --all-extras
check: setup
# shell code checks
bash -c 'shellcheck -e ${sc_disable} tools/* grub.d/* -s bash'
# python flake tests
poetry run flake8 --statistics -j auto --count suse_migration_services
poetry run flake8 --statistics -j auto --count test/unit
test: setup
# python static code checks
poetry run mypy suse_migration_services
# unit tests
poetry run bash -c 'pushd test/unit && pytest -n 5 \
--doctest-modules \
--cov=suse_migration_services \
--no-cov-on-fail \
--cov-report=term-missing \
--cov-fail-under=100 \
--cov-config .coveragerc'
clean:
rm -rf dist