Skip to content

Commit

Permalink
ci(development-stack): Remove mkdoc autoreload function (aristanetwor…
Browse files Browse the repository at this point in the history
…ks#739)

Running mkdoc development server from a container can use high CPU due
to issue on file monitoring.

This commit deactivate this function and add 2 new commands to makefile
to help user:

- make reload

```bash
$ make reload

$ make reload WEBDOC_ID=cvp
```

- make reload-all: Reload both cvp and avd mkdoc containers
  • Loading branch information
titom73 authored Feb 25, 2021
1 parent 7aafd27 commit 1aa591d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion development/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ DOCKER_USER ?= avd
GIT_USERNAME ?= $(shell git config --get user.name)
GIT_EMAIL ?= $(shell git config --get user.email)
MUFFET_TIMEOUT ?= 60
# Container name to
WEBDOC_ID ?= avd

.PHONY: help
help: ## Display help message
Expand Down Expand Up @@ -103,8 +105,17 @@ shell: ## Run a shell attached to ansible container
ansible-upgrade: ## Run a shell attached to ansible container
docker-compose -f $(COMPOSE_FILE) exec -u $(DOCKER_USER) ansible pip install --user --upgrade ansible==$(ANSIBLE_VERSION)

.PHONY: restart
restart: stop start ## Stop and Start docker-compose stack

.PHONY: reload
reload: stop start ## Stop and Start docker-compose stack
reload: ## Reload HTTP container available in docker-compose stack
docker-compose -f $(COMPOSE_FILE) restart webdoc_$(WEBDOC_ID)

.PHONY: reload-all
reload-all: ## Reload HTTP container available in docker-compose stack
docker-compose -f $(COMPOSE_FILE) restart webdoc_avd
docker-compose -f $(COMPOSE_FILE) restart webdoc_cvp

###############################################################################
# Documentation target #
Expand Down
4 changes: 2 additions & 2 deletions development/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
ports:
- 8001:8000
entrypoint: ""
command: ["sh", "-c", "pip install -r ansible-cvp/ansible_collections/arista/cvp/docs/requirements.txt && mkdocs serve --dev-addr=0.0.0.0:8000 -f ansible-cvp/mkdocs.yml"]
command: ["sh", "-c", "pip install -r ansible-cvp/ansible_collections/arista/cvp/docs/requirements.txt && mkdocs serve --no-livereload --dev-addr=0.0.0.0:8000 -f ansible-cvp/mkdocs.yml"]

webdoc_avd:
image: titom73/mkdocs:latest
Expand All @@ -30,4 +30,4 @@ services:
ports:
- 8000:8000
entrypoint: ""
command: ["sh", "-c", "pip install -r ansible-avd/ansible_collections/arista/avd/docs/requirements.txt && mkdocs serve --dev-addr=0.0.0.0:8000 -f ansible-avd/mkdocs.yml"]
command: ["sh", "-c", "pip install -r ansible-avd/ansible_collections/arista/avd/docs/requirements.txt && mkdocs serve --no-livereload --dev-addr=0.0.0.0:8000 -f ansible-avd/mkdocs.yml"]

0 comments on commit 1aa591d

Please sign in to comment.