Fully prepare release package

This commit is contained in:
Fabian Koller 2021-01-23 22:08:36 +01:00
parent 6c3b1db4dd
commit 0d19957d4b
No known key found for this signature in database
GPG Key ID: 4EFE4C946404B82A

View File

@ -5,7 +5,7 @@
pkg: pkg:
- git - git
- npm - npm
- libqpdf-dev - gettext
- name: create temporary git directory - name: create temporary git directory
tempfile: tempfile:
@ -30,26 +30,6 @@
- npm install - npm install
- ./node_modules/.bin/ng build --prod - ./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 - name: clean output directory
file: file:
path: "{{ gitdir.path }}/dist" path: "{{ gitdir.path }}/dist"
@ -75,28 +55,16 @@
- src: Pipfile - src: Pipfile
- src: Pipfile.lock - src: Pipfile.lock
- src: README.md - src: README.md
- src: requirements.txt
- src: paperless.conf.example - src: paperless.conf.example
dest: "paperless.conf" 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 - name: glob all scripts
find: find:
paths: "{{ gitdir.path }}/scripts/" paths: ["{{ gitdir.path }}/scripts/"]
patterns: patterns:
- "*.service" - "*.service"
- "*.sh" - "*.sh"
register: glob register: glob
- name: copy scripts - name: copy scripts
@ -113,6 +81,27 @@
args: args:
chdir: "{{ gitdir.path }}" 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 - name: package app
archive: archive:
path: "{{ gitdir.path }}/dist/" path: "{{ gitdir.path }}/dist/"