Skip to content

Commit

Permalink
build: add "dev-get-id", "dev-enter", and "dev-load-data" targets
Browse files Browse the repository at this point in the history
"dev-enter" is intended to disambiguate this action (start a shell in
the running development container) from the "dev-shell" script (start a
shell in a new development container).
  • Loading branch information
cfm committed Oct 24, 2024
1 parent b80c941 commit 2139edb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,24 @@ dev-tor: ## Run the development server with onion services in a Docker containe
@OFFSET_PORTS='false' DOCKER_BUILD_VERBOSE='true' USE_TOR='true' SLIM_BUILD=1 $(DEVSHELL) $(SDBIN)/run
@echo

.PHONY:
dev-get-id: ## (DOCKER ONLY) Get the ID of the running "make dev" or "make dev-tor" container.
@docker ps --format json --filter "name=securedrop-dev" | jq -r ".ID"

.PHONY:
dev-enter: ## (DOCKER ONLY) Start a shell directly in the running "make dev" or "make dev-tor" container.
@docker exec -it \
$(shell make dev-get-id) \
bash

.PHONY: dev-load-data
dev-load-data: ## (DOCKER ONLY) Run "loaddata.py" in the running "make dev" or "make dev-tor" container. Set $NUM_JOURNALISTS and/or $NUM_SOURCES on the command line as needed.
@docker exec -it \
-e NUM_JOURNALISTS \
-e NUM_SOURCES \
$(shell make dev-get-id) \
./loaddata.py

.PHONY: demo-landing-page
demo-landing-page: ## Serve the landing page for the SecureDrop demo
@echo "███ Building Docker image..."
Expand Down

0 comments on commit 2139edb

Please sign in to comment.