From 29a027f34383883dac66d9aa8b208021ec0c9cc0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D0=B0=D0=BD=D0=B0=D1=81=D0=B8=D0=BD=D0=B3=D1=85?=
 =?UTF-8?q?=D0=B5=20=D0=9C=D1=83=D0=B4=D0=B8=D1=8F=D0=BD=D1=81=D0=B5=D0=BB?=
 =?UTF-8?q?=D0=B0=D0=B3=D0=B5=20=D0=9F=D0=B0=D1=82=D0=BC=D0=B0=20=D0=9A?=
 =?UTF-8?q?=D0=B0=D0=BD=D1=82=D0=B0=20=D0=9A=D1=83=D0=B4=D0=B0=D0=B3=D0=B0?=
 =?UTF-8?q?=D0=BC=D0=BC=D0=B0=D0=BD=D0=B0?=
 <pranasingkhemudiyanselage@edu.hse.ru>
Date: Sun, 4 Sep 2022 18:35:30 +0000
Subject: [PATCH] Update .gitlab-ci.yml file for day5

---
 .gitlab-ci.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..ebca3fe
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,67 @@
+stages:
+  - build
+  - testing
+  - packaging
+ 
+build_application:
+    stage: build
+    tags:
+        - docker_itsoft
+    script:
+        - echo "This application will build here..."
+        - pwd
+        - echo "Build application Done!"
+
+lint-testing:
+    stage: testing
+    tags:
+        - docker_itsoft
+    script:
+        - echo "This application will lint-test here..."
+        - pwd
+        - ls -a
+        - echo "Lint test Done!"
+
+unit-testing:
+    stage: testing
+    tags:
+        - docker_itsoft
+    needs:
+        - job: 'lint-testing'
+          optional: true
+    before_script:
+        - echo "Prepare test data"
+    script:
+        - echo "This application will unit-test here..."
+       
+        - echo "Unit test Done!"
+    rules:
+        - if: '$CI_COMMIT_BRANCH == "master"'
+        - if: '$CI_COMMIT_BRANCH == "develop"'
+        - if: '$CI_PIPELINE_SOURCE == "feature_new"'
+
+build-image-job:
+    stage: packaging
+    tags:
+        - docker_itsoft
+    rules:
+        - if: '$CI_COMMIT_BRANCH == "master"'
+          variables:
+            TAG: 'latest'
+        - if: '$CI_COMMIT_BRANCH == "develop"'
+          variables:
+            TAG: 'dev'
+    image: docker:20.10.16
+    services:
+        - docker:20.10.16-dind
+    parallel:
+        matrix:
+          - SERVICE: [cat, dog, child]
+    script:
+        - echo "This application will package here..."
+        - cd $SERVICE
+        - docker login docker.io -u $DOCKER_USERNAME -p $DOCKER_PWD
+        - docker info
+        - docker build -t docker.io/pathmakantha/$SERVICE:$TAG .
+        - docker push docker.io/pathmakantha/$SERVICE:$TAG      
+        - echo "Packaging Done!"
-- 
GitLab