Skip to content

Commit

Permalink
now using different network for test and run
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin committed Jul 10, 2023
1 parent 751619f commit 58a160c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ build:
docker compose build

init:
docker network create datalake-taxii || echo "Using previously created network datalake-taxii..." && docker compose run --rm --entrypoint "python main.py --init" taxii_integration && docker compose restart medallion
docker network create datalake-taxii || echo "Using previously created network datalake-taxii..." \
&& docker compose run --rm --entrypoint "python main.py --init" taxii_integration \
&& docker compose restart medallion

run:
docker compose run --rm taxii_integration

test:
docker network create datalake-taxii || echo "Using previously created network datalake-taxii..." && docker compose -f docker-compose.test.yml up -d -V nginx_proxy && docker compose -f docker-compose.test.yml run --entrypoint "python main.py --init" taxii_integration && docker compose -f docker-compose.test.yml restart medallion && docker compose -f docker-compose.test.yml run --entrypoint=sh taxii_integration -c "python -m flake8 . --count --max-complexity=10 --max-line-length=120 --show-source --statistics && python -m pytest -s "
docker network create test-datalake-taxii || echo "Using previously created network test-datalake-taxii..." \
&& docker compose -f docker-compose.test.yml up -d -V nginx_proxy \
&& docker compose -f docker-compose.test.yml run --entrypoint "python main.py --init" taxii_integration \
&& docker compose -f docker-compose.test.yml restart medallion \
&& docker compose -f docker-compose.test.yml run --entrypoint=sh taxii_integration -c \
"python -m flake8 . --count --max-complexity=10 --max-line-length=120 --show-source --statistics && python -m pytest -s "
14 changes: 7 additions & 7 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
depends_on:
- medallion
networks:
- datalake-taxii
- test-datalake-taxii

nginx_proxy:
image: nginx
Expand All @@ -25,7 +25,7 @@ services:
depends_on:
- nginx
networks:
datalake-taxii:
test-datalake-taxii:
aliases:
- my.taxii_server.com

Expand All @@ -40,7 +40,7 @@ services:
depends_on:
- nginx_proxy
networks:
- datalake-taxii
- test-datalake-taxii

medallion:
image: ocddev/cti-taxii-server
Expand All @@ -53,7 +53,7 @@ services:
depends_on:
- mongo
networks:
- datalake-taxii
- test-datalake-taxii

mongo:
image: mongo
Expand All @@ -67,13 +67,13 @@ services:
ports:
- 27017:27017
networks:
- datalake-taxii
- test-datalake-taxii

volumes:
data_volume:


networks:
datalake-taxii:
test-datalake-taxii:
external: true
name: datalake-taxii
name: test-datalake-taxii

0 comments on commit 58a160c

Please sign in to comment.