Skip to content

Commit

Permalink
Merge pull request #2471 from HHS/TTAHUB-3516/native-and-clear
Browse files Browse the repository at this point in the history
[TTAHUB-3516] Add support for yarn docker:clear and yarn docker:start:native
  • Loading branch information
GarrettEHill authored Nov 20, 2024
2 parents 58601ea + 1dfe240 commit 367b7a5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
10 changes: 5 additions & 5 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
build:
context: .
profiles:
- minimal_required
- minimal_required_node
command: yarn server
user: ${CURRENT_USER:-root}
ports:
Expand Down Expand Up @@ -35,7 +35,7 @@ services:
build:
context: .
profiles:
- minimal_required
- minimal_required_node
command: yarn start
user: ${CURRENT_USER:-root}
stdin_open: true
Expand All @@ -54,7 +54,7 @@ services:
build:
context: .
profiles:
- minimal_required
- minimal_required_node
command: yarn worker
env_file: .env
depends_on:
Expand All @@ -71,7 +71,7 @@ services:
owasp_zap_backend:
image: softwaresecurityproject/zap-stable:latest
profiles:
- full_stack
- full_stack_zap
platform: linux/arm64
user: zap
command: zap-full-scan.py -t http://backend:8080 -c zap.conf -i -r owasp_report_.html
Expand All @@ -83,7 +83,7 @@ services:
owasp_zap_similarity:
image: softwaresecurityproject/zap-stable:latest
profiles:
- full_stack
- full_stack_zap
platform: linux/arm64
user: zap
command: zap-api-scan.py -t http://similarity:8080/openapi.json -f openapi -I -i -r owasp_api_report.html
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
container_name: postgres_docker
env_file: .env
profiles:
- minimal_required
- minimal_required_postgres
ports:
- "5432:5432"
volumes:
Expand Down Expand Up @@ -51,7 +51,7 @@ services:
build:
context: ./similarity_api
profiles:
- minimal_required
- minimal_required_python
ports:
- "9100:8080"
env_file: .env
Expand All @@ -62,7 +62,7 @@ services:
redis:
image: redis:5.0.6-alpine
profiles:
- minimal_required
- minimal_required_redis
command: ['redis-server', '--requirepass', '$REDIS_PASS']
env_file: .env
ports:
Expand Down
43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,32 @@
"db:seed:prod": "node_modules/.bin/sequelize db:seed:all --options-path .production.sequelizerc",
"db:seed:undo": "node_modules/.bin/sequelize db:seed:undo:all",
"db:seed:undo:prod": "node_modules/.bin/sequelize db:seed:undo:all --options-path .production.sequelizerc",
"docker:deps": "docker compose run --rm backend yarn install && docker compose run --rm frontend yarn install && docker compose run --rm worker yarn install",
"docker:clear": "docker images | grep head-start | awk '{print $3}' | while read x; do docker image rm -f $x; done",
"docker:deps": "docker compose --profile minimal_required_postgres --profile minimal_required_redis run --rm backend yarn install && docker compose --profile minimal_required_postgres --profile minimal_required_redis run --rm frontend yarn install && docker compose --profile minimal_required_postgres --profile minimal_required_redis run --rm worker yarn install",
"docker:reset": "./bin/reset-all",
"docker:start": "docker compose --profile minimal_required up",
"docker:start:full": "docker compose --profile full_stack --profile minimal_required up",
"docker:stop:full": "docker compose --profile full_stack --profile minimal_required down",
"docker:start": "docker compose --profile minimal_required_node --profile minimal_required_postgres --profile minimal_required_redis --profile minimal_required_python up",
"docker:start:native": "docker compose --profile full_stack --profile minimal_required_postgres --profile minimal_required_redis --profile minimal_required_python up & sleep 1 && docker compose -f docker-compose.yml stop db",
"docker:start:full": "docker compose --profile full_stack --profile full_stack_zap --profile minimal_required_node --profile minimal_required_postgres --profile minimal_required_redis --profile minimal_required_python up",
"docker:start:debug": "docker compose --compatibility -f docker-compose.yml -f docker-compose.debug.yml up",
"docker:stop": "docker compose --profile minimal_required down",
"docker:dbs:start": "docker compose -f 'docker-compose.yml' up",
"docker:dbs:stop": "docker compose -f 'docker-compose.yml' down",
"docker:stop": "docker compose --profile full_stack --profile full_stack_zap --profile minimal_required_node --profile minimal_required_postgres --profile minimal_required_redis --profile minimal_required_python down",
"docker:dbs:start": "docker compose -f 'docker-compose.yml' --profile full_stack --profile minimal_required_redis --profile minimal_required_python up",
"docker:dbs:stop": "yarn docker:stop",
"docker:test": "./bin/run-tests",
"docker:test:be": "docker compose run --rm backend yarn test",
"docker:lint": "docker compose run --rm backend yarn lint:ci && docker compose run --rm frontend yarn lint:ci",
"docker:lint:fix": "docker compose run --rm backend yarn lint:fix && docker compose run --rm frontend yarn lint:fix",
"docker:test:be": "yarn docker:yarn:be test",
"docker:lint": "yarn docker:yarn:be lint:ci && yarn docker:yarn:fe lint:ci",
"docker:lint:fix": "yarn docker:yarn:be lint:fix && yarn docker:yarn:fe lint:fix",
"docker:shell:frontend": "docker compose run --rm frontend /bin/bash",
"docker:shell:backend": "docker compose run --rm backend /bin/bash",
"docker:db:migrate": "docker compose run --rm backend node_modules/.bin/sequelize db:migrate && yarn docker:ldm",
"docker:db:migrate:undo": "docker compose run --rm backend node_modules/.bin/sequelize db:migrate:undo",
"docker:db:seed": "docker compose run --rm backend yarn db:seed",
"docker:db:seed:undo": "docker compose run --rm backend yarn db:seed:undo",
"docker:import:system": "docker compose run --rm backend yarn import:system",
"docker:ldm": "docker compose run --rm backend yarn ldm",
"docker:makecolors": "docker compose run --rm frontend yarn makecolors",
"docker:shell:backend": "yarn docker:yarn:be /bin/bash",
"docker:db:migrate": "yarn docker:yarn:be node_modules/.bin/sequelize db:migrate && yarn docker:ldm",
"docker:db:migrate:undo": "yarn docker:yarn:be node_modules/.bin/sequelize db:migrate:undo",
"docker:db:seed": "yarn docker:yarn:be db:seed",
"docker:db:seed:undo": "yarn docker:yarn:be db:seed:undo",
"docker:import:system": "yarn docker:yarn:be import:system",
"docker:ldm": "yarn docker:yarn:be ldm",
"docker:makecolors": "yarn docker:yarn:fe makecolors",
"docker:yarn": "docker compose run yarn",
"docker:yarn:fe": "docker compose run --rm frontend yarn",
"docker:yarn:be": "docker compose run --rm backend yarn",
"docker:yarn:fe": "docker compose run --rm frontend yarn",
"docker:yarn:be": "docker compose --profile minimal_required_postgres --profile minimal_required_redis run --rm backend yarn",
"import:reports:local": "./node_modules/.bin/babel-node ./src/tools/importSSActivityReports.js",
"import:reports": "node ./build/server/src/tools/importSSActivityReports.js",
"import:goals:local": "./node_modules/.bin/babel-node ./src/tools/importTTAPlanGoals.js",
Expand All @@ -97,7 +98,7 @@
"restoreTopics": "node ./build/server/src/tools/restoreTopicsCLI.js",
"restoreTopics:local": "./node_modules/.bin/babel-node ./src/tools/restoreTopicsCLI.js",
"coverage:backend": "./bin/build-coverage-report",
"docker:coverage:backend": "docker compose run --rm backend chmod 744 ./bin/build-coverage-report && ./bin/build-coverage-report",
"docker:coverage:backend": "docker compose --profile minimal_required_postgres --profile minimal_required_redis run --rm backend chmod 744 ./bin/build-coverage-report && ./bin/build-coverage-report",
"populateLegacyResourceTitles": "node ./build/server/src/tools/populateLegacyResourceTitlesCli.js",
"populateLegacyResourceTitles:local": "./node_modules/.bin/babel-node ./src/tools/populateLegacyResourceTitlesCli.js",
"updateCompletedEventReportPilots": "node ./build/server/src/tools/updateCompletedEventReportPilotsCLI.js",
Expand Down

0 comments on commit 367b7a5

Please sign in to comment.