Commit 9632a4f0 authored by Carlos Natalino's avatar Carlos Natalino
Browse files

Adjusting the gitlab CI file.

parent 2c616851
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
# build, tag and push the Docker image to the gitlab registry
build opticalcentralizedattackdetector:
build opticalattackmitigator:
  variables:
    IMAGE_NAME: 'opticalcentralizedattackdetector' # name of the microservice
    IMAGE_NAME: 'opticalattackmitigator' # name of the microservice
    IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
  stage: build
  before_script:
@@ -23,14 +23,14 @@ build opticalcentralizedattackdetector:
      - manifests/$IMAGE_NAME.yaml
      - .gitlab-ci.yml

# apply unit test to the opticalcentralizedattackdetector component
unit test opticalcentralizedattackdetector:
# apply unit test to the opticalattackmitigator component
unit test opticalattackmitigator:
  variables:
    IMAGE_NAME: 'opticalcentralizedattackdetector' # name of the microservice
    IMAGE_NAME: 'opticalattackmitigator' # name of the microservice
    IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
  stage: unit_test
  needs:
    - build opticalcentralizedattackdetector
    - build opticalattackmitigator
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
    - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi
@@ -56,14 +56,14 @@ unit test opticalcentralizedattackdetector:
      - .gitlab-ci.yml


# Deployment of the opticalcentralizedattackdetector service in Kubernetes Cluster
deploy opticalcentralizedattackdetector:
# Deployment of the opticalattackmitigator service in Kubernetes Cluster
deploy opticalattackmitigator:
  variables:
    IMAGE_NAME: 'opticalcentralizedattackdetector' # name of the microservice
    IMAGE_NAME: 'opticalattackmitigator' # name of the microservice
    IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
  stage: deploy
  needs:
    - unit test opticalcentralizedattackdetector
    - unit test opticalattackmitigator
    # - integ_test execute
  script:
    - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml'