Skip to content

Commit

Permalink
Added make docker-docs (#8729)
Browse files Browse the repository at this point in the history
* Changed docs service port to a less common value

* Added make docker-docs

* Added CI workflow for building the docs

* Improved error msg if make docker-docs fails

* Increased timeout from 10s -> 60s

* Reduced docker-docs CI workflow timeout from 60m -> 5m

* Improved UI
  • Loading branch information
Nusnus committed Dec 18, 2023
1 parent d1350f9 commit 20cdf5e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build Docker container
run: make docker-build
run: make docker-build

docker-docs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Build Documentation
run: make docker-docs
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ help:
@echo " docker-lint - Run tox -e lint on docker container."
@echo " docker-unit-tests - Run unit tests on docker container, use '-- -k <TEST NAME>' for specific test run."
@echo " docker-bash - Get a bash shell inside the container."
@echo " docker-docs - Build documentation with docker."

clean: clean-docs clean-pyc clean-build

Expand Down Expand Up @@ -197,6 +198,16 @@ docker-integration-tests:
docker-bash:
@docker-compose -f docker/docker-compose.yml run --rm -w /home/developer/celery celery bash

.PHONY: docker-docs
docker-docs:
@docker-compose -f docker/docker-compose.yml up --build -d docs
@echo "Waiting 60 seconds for docs service to build the documentation inside the container..."
@timeout 60 sh -c 'until docker logs $$(docker-compose -f docker/docker-compose.yml ps -q docs) 2>&1 | \
grep "build succeeded"; do sleep 1; done' || \
(echo "Error! - run manually: docker compose -f ./docker/docker-compose.yml up --build docs"; \
docker-compose -f docker/docker-compose.yml logs --tail=50 docs; false)
@docker-compose -f docker/docker-compose.yml down

.PHONY: catch-all
%: catch-all
@:
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ services:
volumes:
- ../docs:/docs:z
ports:
- "7000:7000"
- "7001:7000"
command: /start-docs

0 comments on commit 20cdf5e

Please sign in to comment.