Fix travis docker image pulling for docs

This commit is contained in:
Tom Moulard 2021-03-16 12:08:04 +01:00 committed by GitHub
parent e5983d96f7
commit 93d099a2f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -16,7 +16,7 @@ env:
script: script:
- echo "Skipping tests... (Tests are executed on SemaphoreCI)" - echo "Skipping tests... (Tests are executed on SemaphoreCI)"
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then make docs; fi - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then travis_retry make docs-pull-images && make docs; fi
before_deploy: before_deploy:
- > - >

View file

@ -127,6 +127,10 @@ docs:
docs-serve: docs-serve:
make -C ./docs docs-serve make -C ./docs docs-serve
## Pull image for doc building
docs-pull-images:
make -C ./docs docs-pull-images
## Generate CRD clientset ## Generate CRD clientset
generate-crd: generate-crd:
./script/update-generated-crd-code.sh ./script/update-generated-crd-code.sh

View file

@ -12,7 +12,7 @@ TRAEFIK_DOCS_CHECK_IMAGE ?= $(TRAEFIK_DOCS_BUILD_IMAGE)-check
SITE_DIR := $(CURDIR)/site SITE_DIR := $(CURDIR)/site
DOCKER_RUN_DOC_PORT := 8000 DOCKER_RUN_DOC_PORT := 8000
DOCKER_RUN_DOC_MOUNTS := -v $(CURDIR):/mkdocs DOCKER_RUN_DOC_MOUNTS := -v $(CURDIR):/mkdocs
DOCKER_RUN_DOC_OPTS := --rm $(DOCKER_RUN_DOC_MOUNTS) -p $(DOCKER_RUN_DOC_PORT):8000 DOCKER_RUN_DOC_OPTS := --rm $(DOCKER_RUN_DOC_MOUNTS) -p $(DOCKER_RUN_DOC_PORT):8000
# Default: generates the documentation into $(SITE_DIR) # Default: generates the documentation into $(SITE_DIR)
@ -22,6 +22,10 @@ docs: docs-clean docs-image docs-lint docs-build docs-verify
docs-serve: docs-image docs-serve: docs-image
docker run $(DOCKER_RUN_DOC_OPTS) $(TRAEFIK_DOCS_BUILD_IMAGE) mkdocs serve docker run $(DOCKER_RUN_DOC_OPTS) $(TRAEFIK_DOCS_BUILD_IMAGE) mkdocs serve
## Pull image for doc building
docs-pull-images:
grep --no-filename -E '^FROM' ./*.Dockerfile | awk '{print $$2}' | sort | uniq | xargs -P 6 -n 1 docker pull
# Utilities Targets for each step # Utilities Targets for each step
docs-image: docs-image:
docker build -t $(TRAEFIK_DOCS_BUILD_IMAGE) -f docs.Dockerfile ./ docker build -t $(TRAEFIK_DOCS_BUILD_IMAGE) -f docs.Dockerfile ./