Commit b96e34f8 authored by Jerome Flesch's avatar Jerome Flesch
Browse files

Moving to a new VPS + adding a pre-production server



Signed-off-by: Jerome Flesch's avatarJerome Flesch <jflesch@openpaper.work>
parent 47729a71
Pipeline #220408 passed with stages
in 25 minutes and 47 seconds
image: debian:stable-slim
stages:
- check
- test
- deploy
check:
stage: check
stage: test
tags:
- linux
- volatile
......@@ -15,12 +15,12 @@ check:
- apt-get install -y -q pycodestyle flake8 python3-flake8 tox
- make check
deploy_dynamic:
deploy_testing:
stage: deploy
only:
- master@World/OpenPaperwork/openpaper.work
- testing@World/OpenPaperwork/openpaper.work
tags:
- openpaper.work
- openpaper.work-testing
variables:
DOCKER_CLIENT_TIMEOUT: "1800"
COMPOSE_HTTP_TIMEOUT: "1800"
......@@ -34,22 +34,21 @@ deploy_dynamic:
- docker container prune -f
- docker image prune -f
deploy_static:
deploy_production:
stage: deploy
only:
- master@World/OpenPaperwork/openpaper.work
tags:
- linux
- volatile
- openpaper.work-master
variables:
DOCKER_CLIENT_TIMEOUT: "1800"
COMPOSE_HTTP_TIMEOUT: "1800"
script:
- sh ./set_apt_proxy.sh
- apt-get install -y -q wget rclone
- apt-get install -y -q python3 python3-virtualenv virtualenv python3-dev
- apt-get install -y -q gettext
- apt-get install -y -q libmariadb-dev
- apt-get install -y -q npm git
- npm install -g bower
- virtualenv -p python3 venv
- source venv/bin/activate && make install
- source venv/bin/activate && ./gen_static_pages.sh static_pages
- ./deliver_static.sh static_pages
- rm -f db.env django.env
- cp /etc/openpaper.work/db.env .
- cp /etc/openpaper.work/django.env .
- docker-compose -p openpaper_work pull
- docker-compose -p openpaper_work build
- docker-compose -p openpaper_work up -d
- docker container prune -f
- docker image prune -f
......@@ -2,5 +2,7 @@
DJANGO_SECRET="aw!h_6=bu)v0o@&u-68een9!-1h(n8e*jftt5*53b3f@s-25wz"
DJANGO_EMAIL_SERVER=mail.local
DJANGO_DEBUG=1
DJANGO_ADMIN_USER=test
DJANGO_ADMIN_PASSWD=test
import os
DEBUG = False
DEBUG = bool(int(os.getenv("DJANGO_DEBUG", "0")))
TEMPLATE_OPTIONS = {'debug': DEBUG}
TEMPLATE_DEBUG = DEBUG
......@@ -15,9 +15,9 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
MEDIA_ROOT = '/var/www/uploads'
ALLOWED_HOSTS = [
'a.flesch.computer',
'openpaper.work',
'127.0.0.1',
'localhost',
'testing.openpaper.work',
'www.openpaper.work',
] # to set if DEBUG != True
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment