From 31585a9c7e456e820bac110af09fda878490653a Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Wed, 2 Sep 2020 12:14:41 +0200 Subject: [PATCH 1/4] Revert to a simpler CI --- .gitlab-ci.yml | 55 +++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07fcd529..a0a1ea9a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,33 +1,21 @@ stages: - - build_docker_image - test - quality-assurance -docker: - stage: build_docker_image - image: - name: gcr.io/kaniko-project/executor:debug - entrypoint: [""] - script: - - mkdir -p /kaniko/.docker - - echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"$CI_BUILD_TOKEN\"}}}" > /kaniko/.docker/config.json - - /kaniko/executor --cache=true --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:latest --destination $CI_REGISTRY_IMAGE:debian - only: - - master - - beta - cache: - key: one-key-to-rule-them-all - paths: - - /cache/ - # Debian Buster py37-django22: stage: test - image: - name: $CI_REGISTRY_IMAGE:debian - entrypoint: [""] + image: debian:buster-backports before_script: - - apt-get update && apt-get install -y tox + - > + apt-get update && + apt-get install --no-install-recommends -t buster-backports -y + python3-django python3-django-crispy-forms + python3-django-extensions python3-django-filters python3-django-polymorphic + python3-djangorestframework python3-django-cas-server python3-psycopg2 python3-pil + python3-babel python3-lockfile python3-pip python3-phonenumbers + python3-bs4 python3-setuptools tox + texlive-latex-extra texlive-lang-french lmodern texlive-fonts-recommended script: tox -e py37-django22 # Ubuntu 20.04 @@ -39,21 +27,28 @@ py38-django22: - ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime && echo Europe/Paris > /etc/timezone - > apt-get update && - apt-get install -y python3-django python3-django-crispy-forms + apt-get install --no-install-recommends -t buster-backports -y + python3-django python3-django-crispy-forms python3-django-extensions python3-django-filters python3-django-polymorphic python3-djangorestframework python3-django-cas-server python3-psycopg2 python3-pil - python3-babel python3-lockfile python3-pip python3-phonenumbers ipython3 - gettext libjs-bootstrap4 fonts-font-awesome tox && - rm -rf /var/lib/apt/lists/* + python3-babel python3-lockfile python3-pip python3-phonenumbers + python3-bs4 python3-setuptools tox + texlive-latex-extra texlive-lang-french lmodern texlive-fonts-recommended script: tox -e py38-django22 linters: stage: quality-assurance - image: - name: $CI_REGISTRY_IMAGE:debian - entrypoint: [""] + image: debian:buster-backports before_script: - - apt-get update && apt-get install -y tox + - > + apt-get update && + apt-get install --no-install-recommends -t buster-backports -y + python3-django python3-django-crispy-forms + python3-django-extensions python3-django-filters python3-django-polymorphic + python3-djangorestframework python3-django-cas-server python3-psycopg2 python3-pil + python3-babel python3-lockfile python3-pip python3-phonenumbers + python3-bs4 python3-setuptools tox + texlive-latex-extra texlive-lang-french lmodern texlive-fonts-recommended script: tox -e linters # Be nice to new contributors, but please use `tox` From 980032bfbf0be64ca7feefeae167080bbb3ad238 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 2 Sep 2020 12:23:45 +0200 Subject: [PATCH 2/4] Remove ltablex and tabularx TeX depency --- apps/wei/templates/wei/weilist_sample.tex | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/wei/templates/wei/weilist_sample.tex b/apps/wei/templates/wei/weilist_sample.tex index 09d3f6be..1ab3b76d 100644 --- a/apps/wei/templates/wei/weilist_sample.tex +++ b/apps/wei/templates/wei/weilist_sample.tex @@ -6,8 +6,6 @@ \usepackage[margin=1.5cm]{geometry} \usepackage{lmodern} -\usepackage{ltablex} -\usepackage{tabularx} \begin{document} \begin{center} @@ -25,7 +23,7 @@ \begin{center} \footnotesize -\begin{tabularx}{\textwidth}{ccccccccc} +\begin{tabular}{ccccccccc} \textbf{Nom} & \textbf{Prénom} & \textbf{Date de naissance} & \textbf{Genre} & \textbf{Section} & \textbf{Bus} & \textbf{Équipe} & \textbf{Rôles} \\ {% for membership in memberships %} @@ -33,7 +31,7 @@ & {{ membership.registration.get_gender_display|safe }} & {{ membership.user.profile.section_generated|safe }} & {{ membership.bus.name|safe }} & {% if membership.team %}{{ membership.team.name|safe }}{% else %}--{% endif %} & {{ membership.roles.first|safe }} \\ {% endfor %} -\end{tabularx} +\end{tabular} \end{center} \footnotesize From fb47e22ae1ae609d2f7c5a36c1d53051dbc6b26a Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Wed, 2 Sep 2020 12:30:38 +0200 Subject: [PATCH 3/4] Remove LaTeX extra --- .gitlab-ci.yml | 6 +++--- Dockerfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a0a1ea9a..e8bd9b44 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ py37-django22: python3-djangorestframework python3-django-cas-server python3-psycopg2 python3-pil python3-babel python3-lockfile python3-pip python3-phonenumbers python3-bs4 python3-setuptools tox - texlive-latex-extra texlive-lang-french lmodern texlive-fonts-recommended + texlive-latex-base texlive-lang-french lmodern texlive-fonts-recommended script: tox -e py37-django22 # Ubuntu 20.04 @@ -27,13 +27,13 @@ py38-django22: - ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime && echo Europe/Paris > /etc/timezone - > apt-get update && - apt-get install --no-install-recommends -t buster-backports -y + apt-get install --no-install-recommends -y python3-django python3-django-crispy-forms python3-django-extensions python3-django-filters python3-django-polymorphic python3-djangorestframework python3-django-cas-server python3-psycopg2 python3-pil python3-babel python3-lockfile python3-pip python3-phonenumbers python3-bs4 python3-setuptools tox - texlive-latex-extra texlive-lang-french lmodern texlive-fonts-recommended + texlive-latex-base texlive-lang-french lmodern texlive-fonts-recommended script: tox -e py38-django22 linters: diff --git a/Dockerfile b/Dockerfile index 8377912e..e2eb7d4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && \ python3-babel python3-lockfile python3-pip python3-phonenumbers ipython3 \ python3-bs4 python3-setuptools \ uwsgi uwsgi-plugin-python3 \ - texlive-latex-extra texlive-lang-french lmodern texlive-fonts-recommended \ + texlive-latex-base texlive-lang-french lmodern texlive-fonts-recommended \ gettext libjs-bootstrap4 fonts-font-awesome && \ rm -rf /var/lib/apt/lists/* From cf7101fc0f60b2c3ccf37a33d76b0a62ef3a1cb3 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Wed, 2 Sep 2020 12:57:46 +0200 Subject: [PATCH 4/4] Less deps in README and ansible role --- README.md | 6 ++++-- ansible/roles/1-apt-basic/tasks/main.yml | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ee843d08..fb3cad6e 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,14 @@ Sinon vous pouvez suivre les étapes ici. ```bash $ sudo apt update - $ sudo apt install -t buster-backports -y python3-django python3-django-crispy-forms \ + $ sudo apt install --no-install-recommends -t buster-backports -y \ + python3-django python3-django-crispy-forms \ python3-django-extensions python3-django-filters python3-django-polymorphic \ python3-djangorestframework python3-django-cas-server python3-psycopg2 python3-pil \ python3-babel python3-lockfile python3-pip python3-phonenumbers ipython3 \ + python3-bs4 python3-setuptools \ uwsgi uwsgi-plugin-python3 \ - texlive-latex-extra texlive-fonts-extra texlive-lang-french \ + texlive-latex-base texlive-lang-french lmodern texlive-fonts-recommended \ gettext libjs-bootstrap4 fonts-font-awesome \ nginx python3-venv git acl ``` diff --git a/ansible/roles/1-apt-basic/tasks/main.yml b/ansible/roles/1-apt-basic/tasks/main.yml index f0ac56b2..fa51de34 100644 --- a/ansible/roles/1-apt-basic/tasks/main.yml +++ b/ansible/roles/1-apt-basic/tasks/main.yml @@ -8,6 +8,7 @@ apt: update_cache: true default_release: buster-backports + install_recommends: false name: # Common tools - gettext @@ -20,6 +21,7 @@ # Python dependencies - python3-babel + - python3-bs4 - python3-django - python3-django-cas-server - python3-django-crispy-forms @@ -32,12 +34,13 @@ - python3-pil - python3-pip - python3-psycopg2 + - python3-setuptools - python3-venv # LaTeX (PDF generation) - - texlive-fonts-extra + - texlive-fonts-recommended - texlive-lang-french - - texlive-latex-extra + - texlive-latex-base # WSGI server - uwsgi