From f2ffcaa5a9cf80447aefee86477964626f118ca8 Mon Sep 17 00:00:00 2001 From: Aarni Halinen Date: Wed, 18 Dec 2019 16:53:35 +0200 Subject: [PATCH 1/2] Parallelize CI a bit --- .gitlab-ci.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9230d03..de944f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,11 @@ stages: - - test - - lint + - qa - publish - deploy test: image: python:3.7 - stage: test + stage: qa services: - postgres:12 variables: @@ -24,14 +23,14 @@ test: pycodestyle: image: python:3.7 - stage: lint + stage: qa script: - pip install pycodestyle - pycodestyle --config=setup.cfg --count . eslint: image: node:alpine - stage: lint + stage: qa before_script: - npm install script: @@ -39,7 +38,7 @@ eslint: remark: image: node:alpine - stage: lint + stage: qa before_script: - npm install script: @@ -59,7 +58,7 @@ publish: - docker build . -t "$IMAGE_NAME" - docker push "$IMAGE_NAME" -deploy_dev: +deploy:dev: stage: deploy image: alpine:latest environment: @@ -82,7 +81,7 @@ deploy_dev: - ssh $DEV_SSH_USER@$DEV_SSH_HOST "docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY" - ssh $DEV_SSH_USER@$DEV_SSH_HOST "bash ~/deployment/deploy_dev.sh \"$IMAGE_NAME\"" -deploy_production: +deploy:production: stage: deploy image: docker:stable only: From c32292c7d93d514b506c78a6dc8a94033f47daad Mon Sep 17 00:00:00 2001 From: Aarni Halinen Date: Wed, 18 Dec 2019 20:29:36 +0200 Subject: [PATCH 2/2] Allow api.sika.sik.party --- .gitlab-ci.yml | 2 +- sikweb/settings.py | 4 ++-- stack-compose.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index de944f5..b931175 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -88,7 +88,7 @@ deploy:production: - master environment: name: production - url: sika.sik.party + url: api.sika.sik.party when: manual variables: DOCKER_HOST: $CI_DOCKER_HOST diff --git a/sikweb/settings.py b/sikweb/settings.py index 908b936..90a65dd 100644 --- a/sikweb/settings.py +++ b/sikweb/settings.py @@ -16,8 +16,8 @@ from sikweb.base import * # SECURITY WARNING: don't run with debug turned on in production! DEBUG = os.getenv('DEBUG', False) == 'True' -URL = os.getenv("HOST", "sika.sik.party") -ALLOWED_HOSTS = ["localhost", "127.0.0.1", URL] +URL = os.getenv("HOST", "api.sika.sik.party") +ALLOWED_HOSTS = ["localhost", "127.0.0.1", "sika.sik.party", URL] if DEBUG: ALLOWED_HOSTS = ["*"] diff --git a/stack-compose.yml b/stack-compose.yml index 1330484..035cc81 100644 --- a/stack-compose.yml +++ b/stack-compose.yml @@ -5,7 +5,7 @@ services: ports: - 5000:80 environment: - - AUTH_BACKEND_URL=https://sika.sik.party/jwt_nginx + - AUTH_BACKEND_URL=https://api.sika.sik.party/jwt_nginx - AUTH_LOGIN_URL=https://sika.sik.party/admin/login volumes: - /home/sik/production/files/static:/srv