From 4196132c167a89b0187de145c4eed1e70eff0b23 Mon Sep 17 00:00:00 2001
From: Mart van Santen <mart@greenhost.nl>
Date: Fri, 19 Nov 2021 12:43:29 +0100
Subject: [PATCH] Add CI/CD for login panel

---
 .gitlab-ci.yml     | 12 ++++++++++++
 docker-compose.yml | 15 +++++++++++----
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5bcca01..df0a61d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,6 +9,18 @@ stages:
   - application-test
   - integration-test
 
+login:
+  stage: build
+  variables:
+    KANIKO_CONTEXT: "login"
+    KANIKO_BUILD_IMAGENAME: $CI_JOB_NAME
+  extends: .kaniko_build
+  only:
+    changes:
+      - login/**/*
+      - .gitlab-ci.yml
+
+
 integration_test_app:
   stage: build-test-images
   variables:
diff --git a/docker-compose.yml b/docker-compose.yml
index 0fe11ba..8adea7a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -27,12 +27,19 @@ services:
       - LOG_LEVEL=debug
       - LOG_LEAK_SENSITIVE_VALUES=true
     restart: unless-stopped
-  psql:
-    image: postgres:11
+  login:
+    build: login/
     environment:
-      - POSTGRES_PASSWORD=secret
+      - FLASK_RUN_HOST=0.0.0.0
+      - FLASK_RUN_PORT=5000
+      - HYDRA_ADMIN_URL=http://hydra:4445
+      - KRATOS_PUBLIC_URL=http://localhost/api
+      - KRATOS_ADMIN_URL=http://kratos-admin:80
+      - DATABASE_URL="postgresql://stackspin:stackspin@postgres/stackspin"
+      - APP_SETTINGS="config.DevelopmentConfig"
     ports:
-      - "5432:5432"
+      - "5000:5000"
+    restart: unless-stopped
   oauth:
     build: ./test/integration_tests
     network_mode: host
-- 
GitLab