From 0d19957d4b96c8414c46d45e21517065fc0f875e Mon Sep 17 00:00:00 2001 From: Fabian Koller Date: Sat, 23 Jan 2021 22:08:36 +0100 Subject: [PATCH] Fully prepare release package --- ansible/tasks/install-source.yml | 63 +++++++++++++------------------- 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/ansible/tasks/install-source.yml b/ansible/tasks/install-source.yml index 64b7dbeb2..04a2991b9 100644 --- a/ansible/tasks/install-source.yml +++ b/ansible/tasks/install-source.yml @@ -5,7 +5,7 @@ pkg: - git - npm - - libqpdf-dev + - gettext - name: create temporary git directory tempfile: @@ -30,26 +30,6 @@ - npm install - ./node_modules/.bin/ng build --prod -# TODO run dev in separate virtualenv -- name: install pipenv - pip: - name: - - pipenv - - pybind11 # building pikepdf for <0.9.14 - extra_args: --upgrade - -- name: allow building with any Python 3 release - lineinfile: - path: "{{ gitdir.path }}/Pipfile" - regexp: '^python_version = ".+"$' - line: python_version = "3" - -- name: install Pipfile dependencies - command: - cmd: pipenv install --dev - args: - chdir: "{{ gitdir.path }}" - - name: clean output directory file: path: "{{ gitdir.path }}/dist" @@ -75,28 +55,16 @@ - src: Pipfile - src: Pipfile.lock - src: README.md + - src: requirements.txt - src: paperless.conf.example dest: "paperless.conf" -# TODO can be copied for >=0.9.14 -- name: generate requirements.txt - command: - cmd: pipenv lock --keep-outdated -r - args: - chdir: "{{ gitdir.path }}" - register: requirements - -- name: write requirements.txt - copy: - content: "{{ requirements.stdout }}" - dest: "{{ gitdir.path }}/dist/paperless-ng/requirements.txt" - - name: glob all scripts find: - paths: "{{ gitdir.path }}/scripts/" + paths: ["{{ gitdir.path }}/scripts/"] patterns: - - "*.service" - - "*.sh" + - "*.service" + - "*.sh" register: glob - name: copy scripts @@ -113,6 +81,27 @@ args: chdir: "{{ gitdir.path }}" +- name: install paperlessng requirements + pip: + requirements: "{{ gitdir.path }}/requirements.txt" + virtualenv: "{{ gitdir.path }}/.venv/" + extra_args: --upgrade + +- name: compile messages + command: "{{ gitdir.path }}/.venv/bin/python3 manage.py compilemessages" + args: + chdir: "{{ gitdir.path }}/dist/paperless-ng/src/" + +- name: collect static files + command: "{{ gitdir.path }}/.venv/bin/python3 manage.py collectstatic --no-input" + args: + chdir: "{{ gitdir.path }}/dist/paperless-ng/src/" + +- name: remove pycache directories + shell: find . -name __pycache__ | xargs rm -r + args: + chdir: "{{ gitdir.path }}/dist/" + - name: package app archive: path: "{{ gitdir.path }}/dist/"