2018-05-29 21:49:40 +02:00
|
|
|
---
|
2020-02-03 23:39:35 +01:00
|
|
|
image: s3lph/matemat-ci:20200203-01
|
2018-05-29 21:49:40 +02:00
|
|
|
|
2018-06-05 22:38:42 +02:00
|
|
|
stages:
|
|
|
|
- test
|
2018-07-11 17:17:00 +02:00
|
|
|
- build
|
2018-11-04 02:35:33 +01:00
|
|
|
- deploy
|
2022-07-19 22:52:56 +02:00
|
|
|
- upload
|
2018-06-05 22:38:42 +02:00
|
|
|
|
2018-09-15 02:12:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
before_script:
|
2018-10-19 22:15:05 +02:00
|
|
|
- export MATEMAT_VERSION=$(python -c 'import matemat; print(matemat.__version__)')
|
2018-09-15 02:12:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-29 21:49:40 +02:00
|
|
|
test:
|
2018-06-05 22:38:42 +02:00
|
|
|
stage: test
|
2018-05-29 21:49:40 +02:00
|
|
|
script:
|
2018-10-19 21:35:35 +02:00
|
|
|
- pip3 install -e .
|
2020-02-03 23:39:35 +01:00
|
|
|
- sudo -u matemat python3.7 -m coverage run --rcfile=setup.cfg -m unittest discover matemat
|
|
|
|
- sudo -u matemat python3.7 -m coverage combine
|
|
|
|
- sudo -u matemat python3.7 -m coverage report --rcfile=setup.cfg
|
2018-06-05 22:32:09 +02:00
|
|
|
|
|
|
|
codestyle:
|
2018-07-11 17:17:00 +02:00
|
|
|
stage: test
|
2018-06-05 22:32:09 +02:00
|
|
|
script:
|
2018-10-19 21:35:35 +02:00
|
|
|
- pip3 install -e .
|
2018-07-10 22:18:57 +02:00
|
|
|
- sudo -u matemat pycodestyle matemat
|
2018-07-10 20:25:34 +02:00
|
|
|
|
2018-09-15 02:12:16 +02:00
|
|
|
|
|
|
|
|
2022-07-16 19:29:30 +02:00
|
|
|
build_docker_tag:
|
2018-07-11 17:17:00 +02:00
|
|
|
stage: build
|
2022-07-16 19:29:30 +02:00
|
|
|
image:
|
2022-07-16 19:31:42 +02:00
|
|
|
name: gcr.io/kaniko-project/executor:debug
|
2022-07-16 19:29:30 +02:00
|
|
|
entrypoint: [""]
|
2018-07-10 20:25:34 +02:00
|
|
|
script:
|
2022-07-16 19:29:30 +02:00
|
|
|
- mkdir -p /kaniko/.docker
|
|
|
|
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
|
|
|
|
- >-
|
|
|
|
/kaniko/executor
|
|
|
|
--context .
|
|
|
|
--dockerfile package/docker/Dockerfile
|
|
|
|
--destination "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA"
|
|
|
|
--destination "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_REF_NAME"
|
|
|
|
--destination "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_TAG"
|
2018-09-15 02:12:16 +02:00
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
|
2022-07-16 19:29:30 +02:00
|
|
|
build_docker_staging:
|
|
|
|
stage: build
|
|
|
|
image:
|
2022-07-16 19:31:42 +02:00
|
|
|
name: gcr.io/kaniko-project/executor:debug
|
2022-07-16 19:29:30 +02:00
|
|
|
entrypoint: [""]
|
|
|
|
script:
|
|
|
|
- mkdir -p /kaniko/.docker
|
|
|
|
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
|
|
|
|
- >-
|
|
|
|
/kaniko/executor
|
|
|
|
--context .
|
|
|
|
--dockerfile package/docker/Dockerfile
|
|
|
|
--destination "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA"
|
|
|
|
--destination "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_REF_NAME"
|
|
|
|
only:
|
|
|
|
- staging
|
|
|
|
|
2018-09-15 02:12:16 +02:00
|
|
|
build_wheel:
|
|
|
|
stage: build
|
|
|
|
script:
|
2020-02-03 23:58:25 +01:00
|
|
|
- python3.7 setup.py egg_info bdist_wheel
|
2018-11-04 02:35:33 +01:00
|
|
|
- cd dist
|
|
|
|
- sha256sum *.whl > SHA256SUMS
|
2018-09-15 02:12:16 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- "dist/*.whl"
|
2018-11-04 02:35:33 +01:00
|
|
|
- dist/SHA256SUMS
|
2018-07-17 20:30:40 +02:00
|
|
|
only:
|
2018-09-15 02:12:16 +02:00
|
|
|
- tags
|
|
|
|
|
2018-11-03 21:28:24 +01:00
|
|
|
build_debian:
|
2018-11-03 18:28:28 +01:00
|
|
|
stage: build
|
|
|
|
script:
|
2018-11-11 23:37:12 +01:00
|
|
|
# The Python package name provided by the python3-magic Debian package is "python-magic" rather than "file-magic".
|
|
|
|
- sed -re 's/file-magic/python-magic/' -i setup.py
|
2018-11-07 14:53:59 +01:00
|
|
|
- echo -n > package/debian/matemat/usr/share/doc/matemat/changelog
|
2018-11-04 14:58:59 +01:00
|
|
|
- |
|
|
|
|
for version in "$(cat CHANGELOG.md | grep '<!-- BEGIN CHANGES' | cut -d ' ' -f 4)"; do
|
2018-11-07 14:53:59 +01:00
|
|
|
echo "matemat (${version}-1); urgency=medium\n" >> package/debian/matemat/usr/share/doc/matemat/changelog
|
|
|
|
cat CHANGELOG.md | grep -A 1000 "<"'!'"-- BEGIN CHANGES ${version} -->" | grep -B 1000 "<"'!'"-- END CHANGES ${version} -->" | tail -n +2 | head -n -1 | sed -re 's/^-/ */g' >> package/debian/matemat/usr/share/doc/matemat/changelog
|
|
|
|
echo "\n -- ${PACKAGE_AUTHOR} $(date -R)\n" >> package/debian/matemat/usr/share/doc/matemat/changelog
|
2018-11-04 14:58:59 +01:00
|
|
|
done
|
2018-11-11 23:13:20 +01:00
|
|
|
- gzip -9n package/debian/matemat/usr/share/doc/matemat/changelog
|
2018-11-03 18:28:28 +01:00
|
|
|
- cp -r static/ package/debian/matemat/usr/lib/matemat/static/
|
|
|
|
- cp -r templates/ package/debian/matemat/usr/lib/matemat/templates/
|
2023-03-28 20:45:09 +02:00
|
|
|
- mkdir -p package/debian/matemat/var/lib/matemat/themes/
|
2023-02-20 10:02:12 +01:00
|
|
|
- cp -r themes/ package/debian/matemat/usr/lib/matemat/themes/
|
2020-02-03 23:58:25 +01:00
|
|
|
- python3.7 setup.py egg_info install --root=package/debian/matemat/ --prefix=/usr --optimize=1
|
2018-11-03 18:28:28 +01:00
|
|
|
- cd package/debian
|
2018-11-07 15:04:11 +01:00
|
|
|
- mkdir -p matemat/usr/lib/python3/dist-packages/
|
2020-02-03 23:58:25 +01:00
|
|
|
- rsync -a matemat/usr/lib/python3.7/site-packages/ matemat/usr/lib/python3/dist-packages/
|
|
|
|
- rm -rf matemat/usr/lib/python3.7/
|
2018-11-07 15:15:52 +01:00
|
|
|
- find matemat/usr/lib/python3/dist-packages -name __pycache__ -exec rm -r {} \; 2>/dev/null || true
|
2018-11-07 14:53:59 +01:00
|
|
|
- find matemat/usr/lib/python3/dist-packages -name '*.pyc' -exec rm {} \;
|
2018-11-03 18:28:28 +01:00
|
|
|
- mv matemat/usr/bin/matemat matemat/usr/lib/matemat/matemat
|
|
|
|
- rm -rf matemat/usr/bin
|
2020-02-03 23:58:25 +01:00
|
|
|
- sed -re 's$#!/usr/local/bin/python3.7$#!/usr/bin/python3$' -i matemat/usr/lib/matemat/matemat
|
2018-11-11 22:35:09 +01:00
|
|
|
- find matemat -type f -exec chmod 0644 {} \;
|
|
|
|
- find matemat -type d -exec chmod 755 {} \;
|
2018-11-11 22:37:55 +01:00
|
|
|
- chmod +x matemat/usr/lib/matemat/matemat matemat/DEBIAN/postinst matemat/DEBIAN/prerm matemat/DEBIAN/postrm
|
2018-11-03 18:28:28 +01:00
|
|
|
- dpkg-deb --build matemat
|
2018-11-04 02:35:33 +01:00
|
|
|
- mv matemat.deb "matemat_${MATEMAT_VERSION}-1_all.deb"
|
2018-11-11 22:31:11 +01:00
|
|
|
- sudo -u nobody lintian "matemat_${MATEMAT_VERSION}-1_all.deb"
|
2018-11-04 02:35:33 +01:00
|
|
|
- sha256sum *.deb > SHA256SUMS
|
2018-11-03 18:28:28 +01:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- "package/debian/*.deb"
|
2018-11-04 02:35:33 +01:00
|
|
|
- package/debian/SHA256SUMS
|
2018-11-03 18:28:28 +01:00
|
|
|
only:
|
|
|
|
- tags
|
2018-09-15 02:12:16 +02:00
|
|
|
|
|
|
|
|
2018-11-04 02:35:33 +01:00
|
|
|
release:
|
|
|
|
stage: deploy
|
|
|
|
script:
|
|
|
|
- python package/release.py
|
|
|
|
only:
|
|
|
|
- tags
|
2022-07-19 22:52:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
repo:
|
|
|
|
stage: upload
|
|
|
|
trigger: s3lph/custom-packages
|
|
|
|
variables:
|
|
|
|
MULTIPROJECT_TRIGGER_JOBNAME: matemat
|
|
|
|
only:
|
2022-07-19 23:16:05 +02:00
|
|
|
- tags
|