diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 66ce2e5e5..1c8566c16 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -215,18 +215,16 @@ jobs: runs-on: ubuntu-latest needs: [file-changes] if: needs.file-changes.outputs.docs == 'true' + timeout-minutes: 10 steps: - uses: actions/checkout@v3 - name: 'start docker-compose stack' run: | - cp development/docker-compose.yml . - sed -i 's/cd\sansible-cvp\/\s\&\&//g' docker-compose.yml - docker-compose -f docker-compose.yml up -d webdoc_cvp - docker-compose -f docker-compose.yml ps + docker-compose -f development/docker-compose.yml up -d webdoc_cvp + docker-compose -f development/docker-compose.yml ps - name: 'test connectivity to mkdoc server' run: | - sleep 30 - until docker exec webdoc_cvp curl -s -I http://localhost:8000/ ; do sleep 2; done + bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' 127.0.0.1:8000)" != "200" ]]; do sleep 5; done' - name: check links for 404 run: | docker run --network container:webdoc_cvp raviqqe/muffet:2.6.1 http://127.0.0.1:8000 \ diff --git a/development/docker-compose.yml b/development/docker-compose.yml index ab9b686aa..140e6fd84 100644 --- a/development/docker-compose.yml +++ b/development/docker-compose.yml @@ -14,21 +14,11 @@ services: command: [ "/bin/sh", "-c", "while true; do sleep 30; done;" ] webdoc_cvp: - image: titom73/mkdocs:latest + image: python:3.11.0-alpine3.17 container_name: webdoc_cvp + working_dir: /data volumes: - - ${PWD}/:/docs - ports: - - 8001:8000 - entrypoint: "" - command: ["sh", "-c", "cd ansible-cvp/ && pip install -r ansible_collections/arista/cvp/docs/requirements.txt && mkdocs serve --no-livereload --dev-addr=0.0.0.0:8000 -f mkdocs.yml"] - - webdoc_avd: - image: titom73/mkdocs:latest - container_name: webdoc_avd - volumes: - - ${PWD}/:/docs + - ${PWD}/:/data ports: - 8000:8000 - entrypoint: "" - command: ["sh", "-c", "cd ansible-avd/ && pip install -r ansible_collections/arista/avd/docs/requirements.txt && mkdocs serve --no-livereload --dev-addr=0.0.0.0:8000 -f mkdocs.yml"] + entrypoint: "sh /data/development/entrypoint.sh" diff --git a/development/entrypoint.sh b/development/entrypoint.sh new file mode 100644 index 000000000..5d9161ddf --- /dev/null +++ b/development/entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# Installing git +echo "Installing dependencies" +apk add --no-cache git git-fast-import + +# Making /data and /site safe for git +git config --global --add safe.directory /data +git config --global --add safe.directory /site + +# install pip requirements +echo "Installing Python requirements" +pip install -r ansible_collections/arista/cvp/docs/requirements.txt --upgrade + +# Start mkdocs +echo "Starting mkdocs" +mkdocs serve --no-livereload --dev-addr=0.0.0.0:8000 -f mkdocs.yml