Skip to content
Snippets Groups Projects
Commit efa3cb27 authored by nd's avatar nd Committed by nd
Browse files

add maintainer scripts to .deb

parent a7f13483
No related branches found
No related tags found
No related merge requests found
...@@ -13,8 +13,11 @@ before_script: ...@@ -13,8 +13,11 @@ before_script:
- python3 -m coverage --version - python3 -m coverage --version
- echo "${CI_COMMIT_TAG}" | grep -qE "v[0-9]+[.][0-9]+[.][0-9]+.*" && export UFFD_PACKAGE_VERSION="${CI_COMMIT_TAG#v}" || export UFFD_PACKAGE_VERSION="${CI_COMMIT_SHA}" - echo "${CI_COMMIT_TAG}" | grep -qE "v[0-9]+[.][0-9]+[.][0-9]+.*" && export UFFD_PACKAGE_VERSION="${CI_COMMIT_TAG#v}" || export UFFD_PACKAGE_VERSION="${CI_COMMIT_SHA}"
build:pip: .build:
stage: build stage: build
build:pip:
extends: .build
script: script:
- pip3 install build - pip3 install build
- PACKAGE_VERSION="${UFFD_PACKAGE_VERSION}" python3 -m build - PACKAGE_VERSION="${UFFD_PACKAGE_VERSION}" python3 -m build
...@@ -23,7 +26,7 @@ build:pip: ...@@ -23,7 +26,7 @@ build:pip:
- dist/* - dist/*
build:apt: build:apt:
stage: build extends: .build
script: script:
- apt update - apt update
- apt-get install -y python3-all debhelper python3-pip git-buildpackage - apt-get install -y python3-all debhelper python3-pip git-buildpackage
...@@ -91,12 +94,17 @@ html5validator: ...@@ -91,12 +94,17 @@ html5validator:
- pages - pages
- html5validator.log - html5validator.log
trans_de: .trans:
stage: test stage: test
script: script:
- ./update_translations.sh de - ./update_translations.sh $TRANSLATION_LANGUAGE
coverage: '/^TOTAL.*\s+(\d+\%)$/' coverage: '/^TOTAL.*\s+(\d+\%)$/'
trans_de:
extends: .trans
variables:
TRANSLATION_LANGUAGE: de
test:package:pip: test:package:pip:
stage: test stage: test
script: script:
...@@ -111,22 +119,23 @@ test:package:apt: ...@@ -111,22 +119,23 @@ test:package:apt:
dependencies: dependencies:
- build:apt - build:apt
publish:pip: .publish:
stage: deploy stage: deploy
rules:
- if: '$CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/'
publish:pip:
extends: .publish
script: script:
- pip3 install twine - pip3 install twine
- TWINE_USERNAME="${GITLABPKGS_USERNAME}" TWINE_PASSWORD="${GITLABPKGS_PASSWORD}" python3 -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/* - TWINE_USERNAME="${GITLABPKGS_USERNAME}" TWINE_PASSWORD="${GITLABPKGS_PASSWORD}" python3 -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
- TWINE_USERNAME="${PYPI_USERNAME}" TWINE_PASSWORD="${PYPI_PASSWORD}" python3 -m twine upload dist/* - TWINE_USERNAME="${PYPI_USERNAME}" TWINE_PASSWORD="${PYPI_PASSWORD}" python3 -m twine upload dist/*
dependencies: dependencies:
- build:pip - build:pip
rules:
- if: '$CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/'
publish:apt: publish:apt:
stage: deploy extends: .publish
script: script:
- exit 0 - exit 0
dependencies: dependencies:
- build:apt - build:apt
rules:
- if: '$CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/'
include setup.py include setup.py
recursive-include uffd *.py *.html *.js *.css *.txt *.po *.cfg
graft uffd/migrations graft uffd/migrations
graft uffd/templates graft uffd/templates
graft uffd/*/templates graft uffd/*/templates
......
...@@ -24,6 +24,7 @@ Depends: ...@@ -24,6 +24,7 @@ Depends:
python3-fido2, python3-fido2,
python3-flask-oauthlib, python3-flask-oauthlib,
python3-flask-babel, python3-flask-babel,
Recommends:
nginx, nginx,
uwsgi, uwsgi,
uwsgi-plugin-python3, uwsgi-plugin-python3,
......
File moved
uwsgi.ini /etc/uffd/
nginx.include.conf /etc/uffd/
debian/uffd.cfg /etc/uffd/
/etc/uffd/uffd.cfg /usr/share/uffd/uffd/instance/config.cfg
#!/bin/sh
set -e
case "$1" in
configure)
getent group uffd >/dev/null 2>&1 || addgroup --system uffd
adduser --system --home /var/lib/uffd --quiet uffd --ingroup uffd || true
chown -R uffd:uffd /var/lib/uffd
chmod 0770 /var/lib/uffd
chown root:uffd /etc/uffd/uffd.cfg
chmod 0640 /etc/uffd/uffd.cfg
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0
#!/bin/sh
set -e
case "$1" in
purge)
delgroup uffd || true
userdel uffd || true
rm -rf /var/lib/uffd
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
esac
#DEBHELPER#
exit 0
FLASK_ENV=production
SQLALCHEMY_DATABASE_URI=sqlite:///var/lib/uffd/db.sqlite
uwsgi.ini /etc/uwsgi/apps-available/uffd.ini
nginx.include.conf /etc/nginx/snippets/uffd-locations.conf
/usr/share/uffd/uffd/instance/config.py /etc/uffd/config.py
...@@ -3,6 +3,7 @@ plugin = python3 ...@@ -3,6 +3,7 @@ plugin = python3
env = PYTHONIOENCODING=UTF-8 env = PYTHONIOENCODING=UTF-8
env = LANG=en_GB.utf8 env = LANG=en_GB.utf8
env = TZ=Europe/Berlin env = TZ=Europe/Berlin
env = CONFIG_FILENAME=/etc/uffd/uffd.cfg
manage-script-name = true manage-script-name = true
chdir = /usr/share/uffd chdir = /usr/share/uffd
module = uffd:create_app() module = uffd:create_app()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment