Commit Graph

35 Commits

Author SHA1 Message Date
Oliver b9fd263899
Docker improvements (#3042)
* Simplified dockerfile

- Changed from alpine to python:slim
- Removed some database libs (because we *connect* to a db, not host it)

* - Add gettext as required package
- Only create inventree user as part of production build (leave admin access for dev build)

* Tweaks for tasks.py

* Fix user permissions (drop to inventree user)

* Drop to the 'inventree' user level as part of init.sh

- As we have mounted volumes at 'run time' we need to ensure that the inventree user has correct permissions!
- Ref: https://stackoverflow.com/questions/39397548/how-to-give-non-root-user-in-docker-container-access-to-a-volume-mounted-on-the

* Adjust user setup

- Only drop to non-root user as part of "production" build
- Mounted external volumes make it tricky when in the dev build
- Might want to revisit this later on

* More dockerfile changes

- reduce required system packages
-

* Add new docker github workflow

* Print some more debug

* GITHUB_BASE_REF

* Add gnupg to base requirements

* Improve debug output during testing

* Refactoring updates for label printing API

- Update weasyprint version to 55.0
- Generate labels as pdf files
- Provide filename to label printing plugin
- Additional unit testing
- Improve extraction of some hidden debug data during TESTING
- Fix a spelling mistake (notifaction -> notification)

* Working on github action

* More testing

* Add requirement for pdf2image

* Fix label printing plugin and update unit testing

* Add required packages for CI

* Move docker files to the top level directory

- This allows us to build the production image directly from soure
- Don't need to re-download the source code from github
- Note: The docker install guide will need to be updated!

* Fix for docker ci file

* Print GIT SHA

* Bake git information into the production image

* Add some exta docstrings to dockerfile

* Simplify version check script

* Extract git commit info

* Extract docker tag from check_version.py

* Newline

* More work on the docker workflow

* Dockerfile fixes

- Directory / path issues

* Dockerfile fixes

- Directory / path issues

* Ignore certain steps on a pull request

* Add poppler-utils to CI

* Consolidate version check into existing CI file

* Don't run docker workflow on pull request

* Pass docker image tag through to the build

Also check .j2k files

* Add supervisord.conf example file back in

* Remove --no-cache-dir option from pip install
2022-05-29 09:40:37 +10:00
Matthias Mair 840ade25cd
Label printing unit test (#3047)
* Adds a very simple sample plugin for label printing

* Test mixin install status and API query

* Better error reporting for label printing API

* pep fixes

* fix assertation

* remove broken assertation

* igonre for coverage

* test the base process of printing

* refactor tests

* clean up basic test

* refactor url

* fix url creation

* test printing multiples

* test all printing endpoints

* test all list options - move api tests

* test for invalid filters

* refactor

* test with no part

* these should not happen
checks are in place upstream

* fix assertation

* do not cover continue parts

* test for wrong implementation

* ignore DB not ready

* remove covage from default parts

* fix url generation

* test debug mode

* fix url assertation

* check that nothing was rendered

Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
2022-05-23 08:54:44 +10:00
Matthias Mair e1d22f538d resort imports 2022-05-20 17:24:51 +02:00
Oliver 9bcbaaa5f5 Remove more python2 stuff 2022-05-17 16:57:31 +10:00
Matthias Mair 0f5c03e44c use direct import instead of text for offload 2022-05-16 17:45:51 +02:00
Matthias 5048d51558
Refactor printer into own base dir 2022-05-15 03:19:47 +02:00
Oliver Walters aed02f6f0f PEP fixes 2022-05-08 22:53:49 +10:00
Oliver Walters 3a9bacb27c Implement new approach for plugin settings
- URL specifies plugin slug and setting key
2022-05-08 22:48:47 +10:00
Matthias e7a0cf7342
fix old url() usage 2022-05-01 22:04:37 +02:00
Matthias de6507e918
update translation commands 2022-05-01 22:03:49 +02:00
Oliver c1b408f8a3 Send notification if printing fails
If label printing fails (due to a plugin error) then the user is notified.
2022-03-25 15:57:32 +11:00
Oliver efc6af5f4c PEP fixes 2022-03-24 16:18:08 +11:00
Oliver 6c25a5805d Allow offloading of label printing to the configured plugin 2022-03-24 14:57:01 +11:00
Oliver f1f07a1977 Extract plugin information from label printing request 2022-03-24 13:31:01 +11:00
Matthias d884e62be1
[FR] Confirm to W293
Fixes #2335
2021-11-23 00:28:23 +01:00
Oliver Walters f405e4b701 Add inline option for reports, too 2021-08-07 22:28:48 +10:00
Oliver Walters ca9536f687 Implement option to display labels "inline" in the browser 2021-08-07 22:09:15 +10:00
Oliver 15cb1e0005 Print part labels 2021-07-08 22:54:41 +10:00
Oliver 1830467487 Add admin / serializer / API for PartLabel model 2021-07-08 22:10:10 +10:00
Oliver Walters 82a3d9ca96 Implements custom naming for generated labels 2021-05-13 13:40:40 +10:00
Matthias f2b0717d10 removes all lines consisting only of spaces
this really bothers me for some reason - nothing technical
2021-05-06 12:11:38 +02:00
Matthias efd14fca64 made translation lazy 2021-04-04 22:47:01 +02:00
Oliver Walters 8c9202de21 Bug fix for label / report filtering 2021-02-23 15:40:31 +11:00
Oliver Walters 7582b9ccf4 PEP fixes 2021-02-22 17:02:33 +11:00
Oliver Walters da715d7381 Refactoring label printing 2021-02-22 16:12:13 +11:00
Oliver Walters 2fa7c8706b Wrap custom filter validation in try/except blocks 2021-02-10 20:40:15 +11:00
Oliver Walters 1b835a71df Print one (or more!) report templates via API 2021-01-18 21:17:19 +11:00
Oliver Walters 1368b06afa PEP fix 2021-01-11 19:46:17 +11:00
Oliver Walters d91700fd39 StockLocation labels are now printable 2021-01-11 18:41:57 +11:00
Oliver Walters a3c5ea1f2b Typo fix 2021-01-09 22:02:33 +11:00
Oliver Walters bdc7367e29 Add endpoint for printing labels 2021-01-09 20:43:48 +11:00
Oliver Walters 44e60a705e Add detail endpoints for the StockItemLabel and StockLocationLabel models 2021-01-09 08:20:29 +11:00
Oliver Walters 7c7a67fcc6 Add filterable API for StockLocation labels 2021-01-08 23:08:30 +11:00
Oliver Walters 80c7ee6dab Add ability to filter label by StockItem 2021-01-08 22:47:47 +11:00
Oliver Walters 446c744462 Expose stock items labels to the API 2021-01-08 22:19:52 +11:00