Skip to content
Snippets Groups Projects
Commit 802a85c8 authored by M9713's avatar M9713
Browse files

Update .gitlab-ci.yml

parent 93b41be5
No related branches found
No related tags found
No related merge requests found
Pipeline #539423 passed
#include: stages:
# - template: Dependency-Scanning.gitlab-ci.yml - build robot
# - template: Security/License-Scanning.gitlab-ci.yml
# - template: Security/Secret-Detection.gitlab-ci.yml build robot:
# - template: Security/SAST.gitlab-ci.yml stage: build robot
# - template: DAST.gitlab-ci.yml
stages:
- build backend
- build frontend
# - test
- deploy mongodb
- deploy backend
- deploy frontend
# - dast
#variables:
# DAST_WEBSITE: "http://vm3733.kaj.pouta.csc.fi:30100/"
# DAST_FULL_SCAN_ENABLED: "true"
# DAST_AUTH_URL: "http://vm3733.kaj.pouta.csc.fi:30100/login"
# DAST_AUTH_USERNAME: “DAST”
# DAST_AUTH_PASSWORD: “DAST”
# SAST_GOSEC_LEVEL: 2
build backend:
stage: build backend
when: manual
image: image:
name: gcr.io/kaniko-project/executor:debug name: gcr.io/kaniko-project/executor:debug
entrypoint: [""] entrypoint: [""]
script:
#Build Backend script:
#Build robot
- echo "Building Backend" - echo "Building robot"
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - 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 - /kaniko/executor --context $CI_PROJECT_DIR/robot-framework --dockerfile $CI_PROJECT_DIR/robot-framework/Dockerfile --destination $CI_REGISTRY_IMAGE:robot
# #include:
# # - template: Dependency-Scanning.gitlab-ci.yml
# # - template: Security/License-Scanning.gitlab-ci.yml
# # - template: Security/Secret-Detection.gitlab-ci.yml
# # - template: Security/SAST.gitlab-ci.yml
# # - template: DAST.gitlab-ci.yml
# stages:
# - build backend
# - build frontend
# # - test
# - deploy mongodb
# - deploy backend
# - deploy frontend
# # - dast
# #variables:
# # DAST_WEBSITE: "http://vm3733.kaj.pouta.csc.fi:30100/"
# # DAST_FULL_SCAN_ENABLED: "true"
# # DAST_AUTH_URL: "http://vm3733.kaj.pouta.csc.fi:30100/login"
# # DAST_AUTH_USERNAME: “DAST”
# # DAST_AUTH_PASSWORD: “DAST”
# # SAST_GOSEC_LEVEL: 2
build frontend: # build backend:
stage: build frontend # stage: build backend
when: manual # when: manual
image: # image:
name: gcr.io/kaniko-project/executor:debug # name: gcr.io/kaniko-project/executor:debug
entrypoint: [""] # entrypoint: [""]
script: # script:
# Build Frontend # #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
- echo "Building Frontend" # build frontend:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json # stage: build frontend
- /kaniko/executor --context $CI_PROJECT_DIR/conduit-front --dockerfile $CI_PROJECT_DIR/conduit-front/Dockerfile --destination $CI_REGISTRY_IMAGE:front
# when: manual
# image:
# name: gcr.io/kaniko-project/executor:debug
# entrypoint: [""]
# script:
# # 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 mongodb: # deploy mongodb:
# tags: # # tags:
# - example # # - example
stage: deploy mongodb # stage: deploy mongodb
when: manual # when: manual
# script: echo "Deploying" # # script: echo "Deploying"
image: bitnami/kubectl:latest # image: bitnami/kubectl:latest
script: # script:
# - kubectl apply -k $CI_PROJECT_DIR/conduit-db/kustomization.yaml # # - kubectl apply -k $CI_PROJECT_DIR/conduit-db/kustomization.yaml
- kubectl apply -f $CI_PROJECT_DIR/conduit-db/mongo-deployment.yaml # - kubectl apply -f $CI_PROJECT_DIR/conduit-db/mongo-deployment.yaml
- kubectl apply -f $CI_PROJECT_DIR/conduit-db/mongo-persistent-volume.yaml # - kubectl apply -f $CI_PROJECT_DIR/conduit-db/mongo-persistent-volume.yaml
- kubectl apply -f $CI_PROJECT_DIR/conduit-db/mongo-pv-claim.yaml # - kubectl apply -f $CI_PROJECT_DIR/conduit-db/mongo-pv-claim.yaml
- kubectl apply -f $CI_PROJECT_DIR/conduit-db/mongo-service.yaml # - kubectl apply -f $CI_PROJECT_DIR/conduit-db/mongo-service.yaml
- kubectl -n default rollout restart deployment mongo-deployment # - kubectl -n default rollout restart deployment mongo-deployment
deploy backend: # deploy backend:
# tags: # # tags:
# - example # # - example
stage: deploy backend # stage: deploy backend
when: manual # when: manual
# script: echo "Deploying" # # script: echo "Deploying"
image: bitnami/kubectl:latest # image: bitnami/kubectl:latest
script: # script:
- kubectl apply -f $CI_PROJECT_DIR/conduit-backend/backend-service.yaml # - kubectl apply -f $CI_PROJECT_DIR/conduit-backend/backend-service.yaml
- kubectl apply -f $CI_PROJECT_DIR/conduit-backend/backend-deployment.yaml # - kubectl apply -f $CI_PROJECT_DIR/conduit-backend/backend-deployment.yaml
- kubectl -n default rollout restart deployment backend # - kubectl -n default rollout restart deployment backend
deploy frontend: # deploy frontend:
# tags: # # tags:
# - example # # - example
stage: deploy frontend # stage: deploy frontend
when: manual # when: manual
# script: echo "Deploying" # # script: echo "Deploying"
image: bitnami/kubectl:latest # image: bitnami/kubectl:latest
script: # script:
- kubectl apply -f $CI_PROJECT_DIR/conduit-front/front-service.yaml # - kubectl apply -f $CI_PROJECT_DIR/conduit-front/front-service.yaml
- kubectl apply -f $CI_PROJECT_DIR/conduit-front/front-deployment.yaml # - kubectl apply -f $CI_PROJECT_DIR/conduit-front/front-deployment.yaml
- kubectl -n default rollout restart deployment front # - kubectl -n default rollout restart deployment front
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment