Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Use a predeploy script instead

Daoud Clarkeef6b87e9cd54
diff --git a/app.json b/app.json
new file mode 100644
index 0000000..adbe94b
--- /dev/null
+++ b/app.json
@@ -0,0 +1,7 @@
+{
+ "scripts": {
+ "dokku": {
+ "predeploy": "rm -r /app/static/* && cp -r /front-end-build/* /app/static/",
+ }
+ }
+}
diff --git a/mwmbl/apps.py b/mwmbl/apps.py
index fd2244d..f829ecc 100644
--- a/mwmbl/apps.py
+++ b/mwmbl/apps.py
@@ -35,14 +35,3 @@ class MwmblConfig(AppConfig):
Process(target=background.run, args=(settings.DATA_PATH,)).start()
Process(target=update_queue_continuously, args=(new_item_queue, queued_batches,)).start()
Process(target=update_urls_continuously, args=(settings.DATA_PATH, new_item_queue)).start()
-
- if not settings.DEBUG:
- # Remove all existing content from the static folder:
- # https://stackoverflow.com/a/1073382
- for root, dirs, files in os.walk('/app/static'):
- for f in files:
- os.unlink(os.path.join(root, f))
- for d in dirs:
- shutil.rmtree(os.path.join(root, d))
-
- shutil.copytree('/front-end-build', '/app/static')