diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3c79864 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://git.entrouvert.org/pre-commit-debian.git + rev: v0.1 + hooks: + - id: pre-commit-debian diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..0cb0174 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +gitea-redmine (0-1) UNRELEASED; urgency=medium + + * Initial packaging. + + -- Frederic Peters Tue, 31 Jan 2023 15:58:56 +0100 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..32804de --- /dev/null +++ b/debian/control @@ -0,0 +1,21 @@ +Source: gitea-redmine +Section: web +Priority: optional +Maintainer: Frederic Peters +Rules-Requires-Root: no +Build-Depends: debhelper-compat (= 13), + dh-sequence-python3, + python3-all, + python3-setuptools, +Standards-Version: 4.6.2 + +Package: gitea-redmine +Architecture: all +Depends: python3-flask, + python3-redminelib, + uwsgi, + uwsgi-plugin-python3, + ${misc:Depends}, + ${python3:Depends}, +Description: gitea/redmine status syncs + Micro application to update redmine issue status on gitea PR changes. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..6924a62 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,25 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://dev.entrouvert.org/projects/gitea-redmine +Upstream-Name: gitea-redmine +Upstream-Contact: info@entrouvert.com + +Files: + * +Copyright: + 2022-2023 Entr’ouvert +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see +Comment: + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/debian/gitea-redmine.install b/debian/gitea-redmine.install new file mode 100644 index 0000000..8e3461f --- /dev/null +++ b/debian/gitea-redmine.install @@ -0,0 +1 @@ +debian/uwsgi.ini /etc/gitea-redmine diff --git a/debian/gitea-redmine.service b/debian/gitea-redmine.service new file mode 100644 index 0000000..af71666 --- /dev/null +++ b/debian/gitea-redmine.service @@ -0,0 +1,23 @@ +[Unit] +Description=Gitea Redmine (Webhook forwarder) +After=syslog.target network.target + +[Service] +Environment=REDMINE_URL=https://dev.entrouvert.org/ +Environment=INCOMING_WEBHOOK_SECRET=XXX +Environment=REDMINE_API_KEY=XXX +Environment=LANG=C.UTF-8 +User=www-data +Group=www-data +ExecStart=/usr/bin/uwsgi --ini /etc/%p/uwsgi.ini +ExecReload=/bin/kill -HUP $MAINPID +KillSignal=SIGQUIT +TimeoutStartSec=0 +PrivateTmp=true +Restart=on-failure +RuntimeDirectory=gitea-redmine +Type=notify +NotifyAccess=all + +[Install] +WantedBy=multi-user.target diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..00a0845 --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +export PYBUILD_NAME=gitea-redmine +export PYBUILD_DISABLE=test + +%: + dh $@ --with python3 --buildsystem=pybuild diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..cb61fa5 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "^[^/]*[.]egg-info/" diff --git a/debian/uwsgi.ini b/debian/uwsgi.ini new file mode 100644 index 0000000..894ef2c --- /dev/null +++ b/debian/uwsgi.ini @@ -0,0 +1,30 @@ +[uwsgi] +auto-procname = true +procname-prefix-spaced = gitea-redmine +strict = true + +plugin = python3 +single-interpreter = true +module = gitea_redmine:app +need-app = true + +http-socket = /run/gitea-redmine/gitea-redmine.sock +chmod-socket = 666 +vacuum = true + +master = true +processes = 5 +enable-threads = true +harakiri = 120 + +max-requests = 500 +max-worker-lifetime = 7200 + +buffer-size = 32768 + +ignore-sigpipe = true +disable-write-exception = true + +if-file = /etc/gitea-redmine/uwsgi-local.ini + include = /etc/gitea-redmine/uwsgi-local.ini +endif = diff --git a/setup.py b/setup.py index 748667c..9a7407a 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,7 @@ setup( author='Agate Berriot', author_email='aberriot@entrouvert.com', packages=find_packages(exclude=['tests']), + py_modules=['gitea_redmine'], include_package_data=True, url='https://gitea.entrouvert.org/entrouvert/gitea-redmine', classifiers=[