Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

added a handy script to make a release package.

Jonas Winkler5a055dfe60e8
diff --git a/.gitignore b/.gitignore
index daef33cc8..4ae903ade 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,8 +65,8 @@ target/
.virtualenv
virtualenv
/venv
-/docker-compose.env
-/docker-compose.yml
+docker-compose.env
+docker-compose.yml
# Used for development
scripts/import-for-development
diff --git a/scripts/make-release.sh b/scripts/make-release.sh
new file mode 100755
index 000000000..b3b48073f
--- /dev/null
+++ b/scripts/make-release.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+set -e
+
+# source root directory of paperless
+PAPERLESS_ROOT=$(git rev-parse --show-toplevel)
+
+# output directory
+PAPERLESS_DIST="$PAPERLESS_ROOT/dist"
+PAPERLESS_DIST_APP="$PAPERLESS_DIST/paperless-ng"
+
+if [ -d "$PAPERLESS_DIST" ]
+then
+ echo "Removing $PAPERLESS_DIST"
+ rm "$PAPERLESS_DIST" -r
+fi
+
+# setup dependencies.
+
+cd "$PAPERLESS_ROOT"
+
+pipenv clean
+pipenv install --dev
+
+# test if the application works.
+
+cd "$PAPERLESS_ROOT/src"
+pipenv run pytest --cov
+pipenv run pycodestyle
+
+# make the documentation.
+
+cd "$PAPERLESS_ROOT/docs"
+make clean html
+
+# copy stuff into place
+
+mkdir "$PAPERLESS_DIST"
+mkdir "$PAPERLESS_DIST_APP"
+mkdir "$PAPERLESS_DIST_APP/docker"
+
+# the application itself
+
+cp "$PAPERLESS_ROOT/.env" \
+ "$PAPERLESS_ROOT/CONTRIBUTING.md" \
+ "$PAPERLESS_ROOT/LICENSE" \
+ "$PAPERLESS_ROOT/Pipfile" \
+ "$PAPERLESS_ROOT/Pipfile.lock" \
+ "$PAPERLESS_ROOT/README.md" "$PAPERLESS_DIST_APP"
+
+cp "$PAPERLESS_ROOT/paperless.conf.example" "$PAPERLESS_DIST_APP/paperless.conf"
+
+# copy python source, templates and static files.
+cd "$PAPERLESS_ROOT"
+find src -wholename '*/templates/*' -o -wholename '*/static/*' -o -name '*.py' | cpio -pdm "$PAPERLESS_DIST_APP"
+
+# build the front end.
+
+cd "$PAPERLESS_ROOT/src-ui"
+ng build --prod --output-hashing none --sourceMap=false --output-path "$PAPERLESS_DIST_APP/src/documents/static/frontend"
+
+# documentation
+cp "$PAPERLESS_ROOT/docs/_build/html/" "$PAPERLESS_DIST_APP/docs" -r
+
+# docker files for building the image yourself
+cp "$PAPERLESS_ROOT/docker/local/"* "$PAPERLESS_DIST_APP"
+cp "$PAPERLESS_ROOT/docker/docker-compose.env" "$PAPERLESS_DIST_APP"
+
+# docker files for pulling from docker hub
+cp "$PAPERLESS_ROOT/docker/hub/"* "$PAPERLESS_DIST"
+cp "$PAPERLESS_ROOT/docker/docker-compose.env" "$PAPERLESS_DIST"
+
+# auxiliary files required for the docker image
+cp "$PAPERLESS_ROOT/docker/docker-entrypoint.sh" "$PAPERLESS_DIST_APP/docker/"
+cp "$PAPERLESS_ROOT/docker/gunicorn.conf.py" "$PAPERLESS_DIST_APP/docker/"
+cp "$PAPERLESS_ROOT/docker/imagemagick-policy.xml" "$PAPERLESS_DIST_APP/docker/"
+cp "$PAPERLESS_ROOT/docker/supervisord.conf" "$PAPERLESS_DIST_APP/docker/"
+
+# try to make the docker build.
+
+cd "$PAPERLESS_DIST_APP"
+
+docker-compose build
+
+# works. package the app!
+
+cd "$PAPERLESS_DIST"
+
+tar -cJf paperless-ng.tar.xz paperless-ng/
diff --git a/src-ui/angular.json b/src-ui/angular.json
index 6b43f7d01..aca54b8e0 100644
--- a/src-ui/angular.json
+++ b/src-ui/angular.json
@@ -13,7 +13,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
- "outputPath": "../src/documents/static/frontend",
+ "outputPath": "dist/paperless-ui",
"outputHashing": "none",
"index": "src/index.html",
"main": "src/main.ts",