Loading src/monitoring/.gitlab-ci.yml +12 −16 Original line number Diff line number Diff line variables: IMAGE_NAME: 'monitoring' # name of the microservice IMAGE_NAME_TEST: 'monitoring-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) # build the Docker image Loading @@ -12,15 +13,6 @@ build monitoring: - src/$IMAGE_NAME/** - .gitlab-ci.yml build monitoring test: stage: build script: - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/tests/Dockerfile ./src/ rules: - changes: - src/$IMAGE_NAME/** - .gitlab-ci.yml # tags the Docker image tag monitoring: stage: build Loading Loading @@ -84,11 +76,15 @@ test monitoring run: test monitoring pytest: stage: test needs: - build monitoring test before_script: - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi - build monitoring script: - docker run -d -p 7070:7070 --name monitoring-tests --network=teraflowbridge --rm "$IMAGE_NAME:$IMAGE_TAG" after_script: - docker stop monitoring-tests - docker build -t "$IMAGE_NAME_TEST:$IMAGE_TAG" -f ./src/$IMAGE_NAME_TEST/tests/Dockerfile ./src/ > pytest_report.txt rules: - changes: - src/$IMAGE_NAME/** - .gitlab-ci.yml artifacts: when: always paths: - pytest_report.txt expire_in: 1 day No newline at end of file src/monitoring/tests/Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -27,4 +27,4 @@ COPY common/logger.py . ENV PORT=7070 EXPOSE 7070 RUN pytest RUN pytest --junitxml=report.xml Loading
src/monitoring/.gitlab-ci.yml +12 −16 Original line number Diff line number Diff line variables: IMAGE_NAME: 'monitoring' # name of the microservice IMAGE_NAME_TEST: 'monitoring-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) # build the Docker image Loading @@ -12,15 +13,6 @@ build monitoring: - src/$IMAGE_NAME/** - .gitlab-ci.yml build monitoring test: stage: build script: - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/tests/Dockerfile ./src/ rules: - changes: - src/$IMAGE_NAME/** - .gitlab-ci.yml # tags the Docker image tag monitoring: stage: build Loading Loading @@ -84,11 +76,15 @@ test monitoring run: test monitoring pytest: stage: test needs: - build monitoring test before_script: - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi - build monitoring script: - docker run -d -p 7070:7070 --name monitoring-tests --network=teraflowbridge --rm "$IMAGE_NAME:$IMAGE_TAG" after_script: - docker stop monitoring-tests - docker build -t "$IMAGE_NAME_TEST:$IMAGE_TAG" -f ./src/$IMAGE_NAME_TEST/tests/Dockerfile ./src/ > pytest_report.txt rules: - changes: - src/$IMAGE_NAME/** - .gitlab-ci.yml artifacts: when: always paths: - pytest_report.txt expire_in: 1 day No newline at end of file
src/monitoring/tests/Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -27,4 +27,4 @@ COPY common/logger.py . ENV PORT=7070 EXPOSE 7070 RUN pytest RUN pytest --junitxml=report.xml