diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-10 11:26:14 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-19 16:15:49 +0100 |
commit | 1292e6705f257ae0b93c356c7d4913d0188c1611 (patch) | |
tree | 2621dda5ebc6941b94ca04347bf4c5bab45a3df4 | |
parent | 77bbd511f65fc812f0b889c4c137cb5e96a84129 (diff) | |
download | Ishtar-1292e6705f257ae0b93c356c7d4913d0188c1611.tar.bz2 Ishtar-1292e6705f257ae0b93c356c7d4913d0188c1611.zip |
🚀 Debian package: delete unecessary files, adapt and add install templates
-rw-r--r-- | .coveragerc | 13 | ||||
-rw-r--r-- | .gitlab-ci.yml | 68 | ||||
-rw-r--r-- | .readthedocs.yaml | 23 | ||||
-rw-r--r-- | .weblate | 3 | ||||
-rw-r--r-- | DEV_DOC.md | 9 | ||||
-rw-r--r-- | example_project/settings.py | 11 | ||||
-rw-r--r-- | install/extra_settings.py | 1 | ||||
-rwxr-xr-x | install/ishtar-install | 6 |
8 files changed, 12 insertions, 122 deletions
diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index a0ec2734c..000000000 --- a/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -omit = - */management/* - */migrations/* - -[report] -exclude_lines = - pragma: no cover - def __repr__ - if self.debug: - if settings.DEBUG - if __name__ == .__main__.: - @(abc\.)?abstractmethod
\ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 82ae0b519..000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,68 +0,0 @@ -before_script: - - apt-get update - - apt-get install -q -y locales locales-all - - echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen - - dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=fr_FR.UTF-8 - - apt-get install -q -y git sed python3-pip libpq-dev python3-dev libjpeg-dev zlib1g-dev libxml2-dev libxslt1-dev libgeos-dev python3-cairocffi tidy libtidy-dev binutils libproj-dev gdal-bin libpangocairo-1.0-0 pandoc graphviz python3-argon2 file gettext postgresql postgresql-13-postgis-3 - - pip3 install -r requirements.txt - - cp Makefile.example Makefile - - su -c "createuser -w -d ishtar_test" postgres - - su -c "createdb -E UTF8 -O ishtar_test ishtar_test" postgres - - su -c "createdb -E UTF8 -O ishtar_test test_ishtar_test" postgres - - su -c "psql -c \"ALTER ROLE ishtar_test WITH PASSWORD 'ishtar_test';\"" postgres - - su -c "psql -d ishtar_test -c 'CREATE EXTENSION postgis;'" postgres - - su -c "psql -d test_ishtar_test -c 'CREATE EXTENSION postgis;'" postgres - -after_script: - - su -c "dropdb ishtar_test" postgres - - su -c "dropdb test_ishtar_test" postgres - - su -c "dropuser ishtar_test" postgres - -build-v4: - stage: "build" - script: - - sed -i -e 's/"registration"/"django_registration"/' example_project/settings.py - - cp example_project/local_settings.py.gitlab-ci example_project/local_settings.py - - mkdir -p /var/log/django/ - - make build_gitlab - tags: - - bullseye-shell - only: - - main - - develop - -test-v4: - stage: "test" - script: - - sed -i -e 's/"registration"/"django_registration"/' example_project/settings.py - - cp example_project/local_settings.py.gitlab-ci example_project/local_settings.py - - mkdir -p /var/log/django/ - - make soft_test_gitlab - tags: - - bullseye-shell - only: - - main - - develop - -debian: - stage: "test" - script: - - apt-get install -q -y devscripts build-essential lintian wget dh-python python3-all sudo findutils - - apt-get install -q -y libpq-dev python3-dev libjpeg-dev zlib1g-dev libxml2-dev libxslt1-dev libgeos-dev libtidy-dev binutils libproj-dev python3-setuptools - - wget -O /etc/apt/sources.list.d/iggdrasil.list http://deb.iggdrasil.net/apt/debian/dists/bullseye/iggdrasil.list - - wget -O - http://deb.iggdrasil.net/iggdrasil.gpg.key | apt-key add - - - apt-get update - - python3 -c 'import re;print(" ".join([re.search(r"(^[^(]*)", p).group(1).strip() for p in open("debian/control", "r").read().split("python3:Depends}")[1].split("Description:")[0].replace(",", "").split("\n") if p and "Recommends" not in p]))' > /tmp/packages.txt - - xargs apt-get -q -y install < /tmp/packages.txt - - cp Makefile.example Makefile - - make deb - - dpkg -i ../python3-django-ishtar_*_all.deb - - /etc/init.d/postgresql start - - INSTANCE=my_ishtar URL=localhost MAX_UPLOAD_SIZE=100 ishtar-prepare-instance - - sudo -u postgres createdb -E UTF8 -O ishtar-my_ishtar test_ishtar-my_ishtar - - sudo -u postgres psql -d test_ishtar-my_ishtar -c 'CREATE EXTENSION postgis;' - - cd /srv/ishtar/my_ishtar && python3 ./manage.py test -k archaeological_operations ishtar_common archaeological_context_records archaeological_files archaeological_finds archaeological_warehouse - tags: - - bullseye - only: - - bullseye diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index 52faf18dd..000000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# .readthedocs.yaml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -formats: - - pdf - -# Set the version of Python and other tools you might need -build: - os: ubuntu-22.04 - tools: - python: "3.9" - -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: docs/fr/source/conf.py - -python: - install: - - requirements: requirements_rtd.txt
\ No newline at end of file diff --git a/.weblate b/.weblate deleted file mode 100644 index 41a384f54..000000000 --- a/.weblate +++ /dev/null @@ -1,3 +0,0 @@ -[weblate] -url = https://translate.iggdrasil.net/ -translation = WIP/i18n diff --git a/DEV_DOC.md b/DEV_DOC.md deleted file mode 100644 index b3556fcfe..000000000 --- a/DEV_DOC.md +++ /dev/null @@ -1,9 +0,0 @@ -Attributes use to manage post-process: - -- `skip_history_when_saving`: do not record last modified date and creation/update author -- `_post_saved_geo`: do not process geo item attached -- `_cached_label_checked`: do not process cached labels -- `_external_id_changed`: do not check external_id -- `_search_updated`: do not reindex search -- `_no_move`: do not move associated images on save - to be checked -- `no_post_process()`: set to True previous attributes diff --git a/example_project/settings.py b/example_project/settings.py index 3c0accc82..3ac6c2fb8 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -321,15 +321,15 @@ DATA_UPLOAD_MAX_NUMBER_FIELDS = 10240 # path to the "dot" program to generate graph DOT_BINARY = "/usr/bin/dot" -PDFTOPPM_BINARY = "" +PDFTOPPM_BINARY = "/usr/bin/pdftoppm" TEST_RUNNER = "ishtar_common.tests.ManagedModelTestRunner" SELENIUM_TEST = False CELERY_BROKER_URL = "" SENTRY_ID = None DISTRIBUTION = "source" -LIB_BASE_PATH = ROOT_PATH + "../" -FIXTURE_AUTH_PATH = ROOT_PATH + "../" +LIB_BASE_PATH = "/usr/lib/python3/dist-packages/" +FIXTURE_AUTH_PATH = "/usr/share/python3-django-ishtar/" SHARE_BASE_PATH = FIXTURE_AUTH_PATH AUTH_PASSWORD_VALIDATORS = [] @@ -461,6 +461,11 @@ def filter_irrelevant_errors(event, hint): return event +try: + from custom_settings import * +except ImportError: + pass + if SENTRY_ID and sentry_sdk: sentry_integrations = [DjangoIntegration()] if USE_BACKGROUND_TASK: diff --git a/install/extra_settings.py b/install/extra_settings.py new file mode 100644 index 000000000..df20af1bb --- /dev/null +++ b/install/extra_settings.py @@ -0,0 +1 @@ +EXTRA_VERSION = 'debian' diff --git a/install/ishtar-install b/install/ishtar-install index 2e4ef9fc0..ced980082 100755 --- a/install/ishtar-install +++ b/install/ishtar-install @@ -331,7 +331,7 @@ EOF # Run setup for each distro accordingly case "$lsb_dist" in ubuntu|debian|raspbian) - if [ "$dist_version" != "buster" ] ; then + if [ "$dist_version" != "bullseye" ] ; then echo "" cecho r " Sorry this script cannot manage your version of Debian/Ubuntu." echo "" @@ -396,12 +396,12 @@ EOF ( set -x; $sh_c 'sleep 3; apt-get install -y -q uwsgi uwsgi-plugin-python3 nginx' ) fi - if [ "$dist_version" == "buster" ]; then + if [ "$dist_version" == "bullseye" ]; then if [ "$default_db" == '127.0.0.1' ]; then echo "-------------------------------------------------------------------------------"; cecho y "Installing postgresql" echo "" - POSTGIS=postgresql-11-postgis-2.5 + POSTGIS=postgresql-13-postgis-3 ( set -x; $sh_c 'sleep 3; apt-get install -y -q postgresql postgresql-contrib '$POSTGIS' '$POSTGIS'-scripts' ) fi echo "-------------------------------------------------------------------------------"; |