Skip to content
Snippets Groups Projects
Commit cc438416 authored by Shayan Hajipour's avatar Shayan Hajipour
Browse files

refactor: context container removed from .gitlab-ci.yml of qos-profile

parent 9b7ed9ee
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!257Resolve "Create QoSProfile component"
......@@ -50,24 +50,18 @@ unit_test qos_profile:
- 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 --driver=bridge teraflowbridge; fi
# Context-related
# QoSProfile-related
- if docker container ls | grep crdb; then docker rm -f crdb; else echo "CockroachDB container is not in the system"; fi
- if docker volume ls | grep crdb; then docker volume rm -f crdb; else echo "CockroachDB volume is not in the system"; fi
- if docker container ls | grep nats; then docker rm -f nats; else echo "NATS container is not in the system"; fi
# Context-related
- if docker container ls | grep context; then docker rm -f context; else echo "context image is not in the system"; fi
# QoSProfile-related
- if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi
script:
- docker pull "cockroachdb/cockroach:latest-v22.2"
- docker pull "nats:2.9"
- docker pull "$CI_REGISTRY_IMAGE/context:$IMAGE_TAG"
- docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
# Context preparation
# environment preparation
- docker volume create crdb
- >
docker run --name crdb -d --network=teraflowbridge -p 26257:26257 -p 8080:8080
......@@ -88,19 +82,12 @@ unit_test qos_profile:
- NATS_ADDRESS=$(docker inspect nats --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}")
- echo $NATS_ADDRESS
- >
docker run --name context -d -p 1010:1010
--env "CRDB_URI=cockroachdb://tfs:tfs123@${CRDB_ADDRESS}:26257/tfs_test?sslmode=require"
--env "MB_BACKEND=nats"
--env "NATS_URI=nats://tfs:tfs123@${NATS_ADDRESS}:4222"
--network=teraflowbridge
$CI_REGISTRY_IMAGE/context:$IMAGE_TAG
- CONTEXTSERVICE_SERVICE_HOST=$(docker inspect context --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}")
- echo $CONTEXTSERVICE_SERVICE_HOST
# QoSProfile preparation
- >
docker run --name $IMAGE_NAME -d -p 3030:3030
--env "CONTEXTSERVICE_SERVICE_HOST=${CONTEXTSERVICE_SERVICE_HOST}"
--env "CRDB_URI=cockroachdb://tfs:tfs123@${CRDB_ADDRESS}:26257/tfs_test?sslmode=require"
--env "MB_BACKEND=nats"
--env "NATS_URI=nats://tfs:tfs123@${NATS_ADDRESS}:4222"
--volume "$PWD/src/$IMAGE_NAME/tests:/opt/results"
--network=teraflowbridge
$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
......@@ -108,7 +95,6 @@ unit_test qos_profile:
# Check status before the tests
- sleep 5
- docker ps -a
- docker logs context
- docker logs $IMAGE_NAME
# Run the tests
......@@ -121,11 +107,9 @@ unit_test qos_profile:
after_script:
# Check status after the tests
- docker ps -a
- docker logs context
- docker logs $IMAGE_NAME
- docker rm -f $IMAGE_NAME
- docker rm -f context
- docker rm -f $IMAGE_NAME crdb nats
- docker volume rm -f crdb
......
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