From 7e6b0827f32e7adb033b6f27038204cd62aa8438 Mon Sep 17 00:00:00 2001
From: M9713 <m9713@student.jamk.fi>
Date: Mon, 1 Nov 2021 21:27:02 +0200
Subject: [PATCH] Update .gitlab-ci.yml

---
 .gitlab-ci.yml | 46 +++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 41 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a7b633c..0c7bdc3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,42 @@
-# This file is a template, and might need editing before it works on your project.
-# This template moved to Jobs/Secret-Detection.gitlab-ci.yml in GitLab 14.0
-# Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/292977
+stages:
+  - build
+  - deploy
 
-include:
-  template: Jobs/Secret-Detection.gitlab-ci.yml
+build:
+  stage: build
+  
+  when: manual 
+
+  image:
+    name: gcr.io/kaniko-project/executor:debug
+    entrypoint: [""]
+ 
+  script:
+
+#  # Build Backend
+#   
+#    - echo "Building Backend"
+#    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
+#    - /kaniko/executor --context $CI_PROJECT_DIR/conduit-backend --dockerfile $CI_PROJECT_DIR/conduit-backend/Dockerfile --destination $CI_REGISTRY_IMAGE:backend
+  
+  # Build Frontend
+
+    - echo "Building Frontend"
+    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
+    - /kaniko/executor --context $CI_PROJECT_DIR/conduit-front --dockerfile $CI_PROJECT_DIR/conduit-front/Dockerfile --destination $CI_REGISTRY_IMAGE:front
+
+deploy:
+
+#    tags:
+#      - example
+
+    stage: deploy
+
+    when: manual
+
+    script: echo "Deploying"
+    image: bitnami/kubectl:latest
+    script:
+         - kubectl apply -f service.yaml
+         - kubectl apply -f deployment.yaml
+         - kubectl -n default rollout restart deployment default
-- 
GitLab