From 59951a12e28ab6328c7c1139e593f259fc13db13 Mon Sep 17 00:00:00 2001 From: Matthias Mair <66015116+matmair@users.noreply.github.com> Date: Fri, 29 Oct 2021 18:05:25 +0200 Subject: [PATCH] Gitpod (#22) * Create .gitpod.yml * split up command * monolythic may be better * set envs per export * use dev for data * trying the split again * added sync command * cleanup * Update .gitpod.yml settings for prebuilds --- .gitpod.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000000..24792f2924 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,42 @@ +# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/ +tasks: + - name: Setup django + init: | + export INVENTREE_DB_ENGINE='sqlite3' + export INVENTREE_DB_NAME='/workspace/InvenTree/dev/database.sqlite3' + export INVENTREE_MEDIA_ROOT='/workspace/InvenTree/dev/media' + export INVENTREE_STATIC_ROOT='/workspace/InvenTree/dev/static' + export PIP_USER='no' + + python3 -m venv venv + source venv/bin/activate + pip install invoke + inv install + mkdir dev + inv update + echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'test@test.com', 'inventree')" | python InvenTree/manage.py shell + gp sync-done setup_server + + - name: Start server + command: | + gp sync-await setup_server + export INVENTREE_DB_ENGINE='sqlite3' + export INVENTREE_DB_NAME='/workspace/InvenTree/dev/database.sqlite3' + export INVENTREE_MEDIA_ROOT='/workspace/InvenTree/dev/media' + export INVENTREE_STATIC_ROOT='/workspace/InvenTree/dev/static' + + source venv/bin/activate + inv server + +# List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/ +ports: + - port: 8000 + onOpen: open-preview + +github: + prebuilds: + master: true + pullRequests: false + pullRequestsFromForks: true + addBadge: true + addLabel: gitpod-ready