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
Branches
Tags
No related merge requests found
......@@ -13,8 +13,11 @@ before_script:
- 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}"
build:pip:
.build:
stage: build
build:pip:
extends: .build
script:
- pip3 install build
- PACKAGE_VERSION="${UFFD_PACKAGE_VERSION}" python3 -m build
......@@ -23,7 +26,7 @@ build:pip:
- dist/*
build:apt:
stage: build
extends: .build
script:
- apt update
- apt-get install -y python3-all debhelper python3-pip git-buildpackage
......@@ -91,12 +94,17 @@ html5validator:
- pages
- html5validator.log
trans_de:
.trans:
stage: test
script:
- ./update_translations.sh de
- ./update_translations.sh $TRANSLATION_LANGUAGE
coverage: '/^TOTAL.*\s+(\d+\%)$/'
trans_de:
extends: .trans
variables:
TRANSLATION_LANGUAGE: de
test:package:pip:
stage: test
script:
......@@ -111,22 +119,23 @@ test:package:apt:
dependencies:
- build:apt
publish:pip:
.publish:
stage: deploy
rules:
- if: '$CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/'
publish:pip:
extends: .publish
script:
- 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="${PYPI_USERNAME}" TWINE_PASSWORD="${PYPI_PASSWORD}" python3 -m twine upload dist/*
dependencies:
- build:pip
rules:
- if: '$CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/'
publish:apt:
stage: deploy
extends: .publish
script:
- exit 0
dependencies:
- build:apt
rules:
- if: '$CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/'
include setup.py
recursive-include uffd *.py *.html *.js *.css *.txt *.po *.cfg
graft uffd/migrations
graft uffd/templates
graft uffd/*/templates
......
......@@ -24,6 +24,7 @@ Depends:
python3-fido2,
python3-flask-oauthlib,
python3-flask-babel,
Recommends:
nginx,
uwsgi,
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
env = PYTHONIOENCODING=UTF-8
env = LANG=en_GB.utf8
env = TZ=Europe/Berlin
env = CONFIG_FILENAME=/etc/uffd/uffd.cfg
manage-script-name = true
chdir = /usr/share/uffd
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