From 57bfa64bd08b96388782ab37f836dfb1080b0bb0 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 15 Jan 2020 00:10:20 +0100 Subject: [PATCH] deploy docs page --- .drone.jsonnet | 83 +++++++++++++++++++++++++-- .drone.yml | 149 ++++++++++++++++++++++++++++++++++++------------- .gitignore | 6 ++ docs | 1 + 4 files changed, 196 insertions(+), 43 deletions(-) create mode 160000 docs diff --git a/.drone.jsonnet b/.drone.jsonnet index 52699d8..4e7fa88 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -232,6 +232,83 @@ local PipelineBuildContainer(arch="amd64") = { }, }; +local PipelineDocs = { + kind: "pipeline", + name: "docs", + platform: { + os: "linux", + arch: "amd64", + }, + concurrency: { + limit: 1 + }, + steps: [ + { + name: "assets", + image: "byrnedo/alpine-curl", + commands: [ + "mkdir -p docs/themes/hugo-geekdoc/", + "curl -L https://github.com/xoxys/hugo-geekdoc/releases/latest/download/hugo-geekdoc.tar.gz | tar -xz -C docs/themes/hugo-geekdoc/ --strip-components=1", + ], + }, + { + name: "test", + image: "klakegg/hugo:0.59.1-ext-alpine", + commands: [ + "cd docs/ && hugo-official", + ] + }, + { + name: "freeze", + image: "appleboy/drone-ssh", + settings: { + host: { from_secret: "ssh_host" }, + key: { from_secret: "ssh_key" }, + script: [ + "cp -R /var/www/virtual/geeklab/html/ansible-later.geekdocs.de/ /var/www/virtual/geeklab/html/ansiblelater_freeze/", + "ln -sfn /var/www/virtual/geeklab/html/ansiblelater_freeze /var/www/virtual/geeklab/ansible-later.geekdocs.de", + ], + username: { from_secret: "ssh_username" }, + }, + }, + { + name: "publish", + image: "appleboy/drone-scp", + settings: { + host: { from_secret: "ssh_host" }, + key: { from_secret: "ssh_key" }, + rm: true, + source: "docs/public/*", + strip_components: 2, + target: "/var/www/virtual/geeklab/html/ansible-later.geekdocs.de/", + username: { from_secret: "ssh_username" }, + }, + }, + { + name: "cleanup", + image: "appleboy/drone-ssh", + settings: { + host: { from_secret: "ssh_host" }, + key: { from_secret: "ssh_key" }, + script: [ + "ln -sfn /var/www/virtual/geeklab/html/ansible-later.geekdocs.de /var/www/virtual/geeklab/ansible-later.geekdocs.de", + "rm -rf /var/www/virtual/geeklab/html/ansiblelater_freeze/", + ], + username: { from_secret: "ssh_username" }, + }, + }, + ], + depends_on: [ + "build-package", + "build-container-amd64", + "build-container-arm64", + "build-container-arm", + ], + trigger: { + ref: ["refs/heads/master", "refs/tags/**"], + }, +}; + local PipelineNotifications = { kind: "pipeline", name: "notifications", @@ -301,10 +378,7 @@ local PipelineNotifications = { }, ], depends_on: [ - "build-package", - "build-container-amd64", - "build-container-arm64", - "build-container-arm" + "docs" ], trigger: { ref: ["refs/heads/master", "refs/tags/**"], @@ -320,5 +394,6 @@ local PipelineNotifications = { PipelineBuildContainer(arch="amd64"), PipelineBuildContainer(arch="arm64"), PipelineBuildContainer(arch="arm"), + PipelineDocs, PipelineNotifications, ] diff --git a/.drone.yml b/.drone.yml index 49580af..e23e4ef 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,8 +20,8 @@ steps: trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** --- kind: pipeline @@ -37,7 +37,7 @@ steps: image: python:2.7 commands: - pip install tox -qq - - "tox -e $(tox -l | grep py27 | xargs | sed 's/ /,/g') -q" + - tox -e $(tox -l | grep py27 | xargs | sed 's/ /,/g') -q environment: PY_COLORS: 1 depends_on: @@ -48,7 +48,7 @@ steps: image: python:3.5 commands: - pip install tox -qq - - "tox -e $(tox -l | grep py35 | xargs | sed 's/ /,/g') -q" + - tox -e $(tox -l | grep py35 | xargs | sed 's/ /,/g') -q environment: PY_COLORS: 1 depends_on: @@ -59,7 +59,7 @@ steps: image: python:3.6 commands: - pip install tox -qq - - "tox -e $(tox -l | grep py36 | xargs | sed 's/ /,/g') -q" + - tox -e $(tox -l | grep py36 | xargs | sed 's/ /,/g') -q environment: PY_COLORS: 1 depends_on: @@ -70,7 +70,7 @@ steps: image: python:3.7 commands: - pip install tox -qq - - "tox -e $(tox -l | grep py37 | xargs | sed 's/ /,/g') -q" + - tox -e $(tox -l | grep py37 | xargs | sed 's/ /,/g') -q environment: PY_COLORS: 1 depends_on: @@ -81,7 +81,7 @@ steps: image: python:3.8-rc commands: - pip install tox -qq - - "tox -e $(tox -l | grep py38-rc | xargs | sed 's/ /,/g') -q" + - tox -e $(tox -l | grep py38-rc | xargs | sed 's/ /,/g') -q environment: PY_COLORS: 1 depends_on: @@ -92,7 +92,7 @@ steps: image: python:3.7 commands: - pip install codecov - - "coverage combine .tox/py*/.coverage" + - coverage combine .tox/py*/.coverage - codecov --required environment: CODECOV_TOKEN: @@ -108,8 +108,8 @@ steps: trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** depends_on: - lint @@ -136,8 +136,8 @@ steps: trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** depends_on: - test @@ -161,7 +161,7 @@ steps: pull: always image: alpine commands: - - "cd dist/ && sha256sum * > ../sha256sum.txt" + - cd dist/ && sha256sum * > ../sha256sum.txt - name: publish-github pull: always @@ -170,14 +170,14 @@ steps: api_key: from_secret: github_token files: - - "dist/*" + - dist/* - sha256sum.txt note: CHANGELOG.md overwrite: true - title: "${DRONE_TAG}" + title: ${DRONE_TAG} when: ref: - - "refs/tags/**" + - refs/tags/** - name: publish-pypi pull: always @@ -191,13 +191,13 @@ steps: from_secret: pypi_username when: ref: - - "refs/tags/**" + - refs/tags/** trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** depends_on: - security @@ -230,7 +230,7 @@ steps: from_secret: docker_username when: ref: - - "refs/pull/**" + - refs/pull/** - name: publish pull: always @@ -247,13 +247,13 @@ steps: when: ref: - refs/heads/master - - "refs/tags/**" + - refs/tags/** trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** depends_on: - security @@ -286,7 +286,7 @@ steps: from_secret: docker_username when: ref: - - "refs/pull/**" + - refs/pull/** - name: publish pull: always @@ -303,13 +303,13 @@ steps: when: ref: - refs/heads/master - - "refs/tags/**" + - refs/tags/** trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** depends_on: - security @@ -342,7 +342,7 @@ steps: from_secret: docker_username when: ref: - - "refs/pull/**" + - refs/pull/** - name: publish pull: always @@ -359,17 +359,91 @@ steps: when: ref: - refs/heads/master - - "refs/tags/**" + - refs/tags/** trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** depends_on: - security +--- +kind: pipeline +name: docs + +platform: + os: linux + arch: amd64 + +concurrency: + limit: 1 + +steps: +- name: assets + image: byrnedo/alpine-curl + commands: + - mkdir -p docs/themes/hugo-geekdoc/ + - curl -L https://github.com/xoxys/hugo-geekdoc/releases/latest/download/hugo-geekdoc.tar.gz | tar -xz -C docs/themes/hugo-geekdoc/ --strip-components=1 + +- name: test + image: klakegg/hugo:0.59.1-ext-alpine + commands: + - cd docs/ && hugo-official + +- name: freeze + image: appleboy/drone-ssh + settings: + host: + from_secret: ssh_host + key: + from_secret: ssh_key + script: + - cp -R /var/www/virtual/geeklab/html/ansible-later.geekdocs.de/ /var/www/virtual/geeklab/html/ansiblelater_freeze/ + - ln -sfn /var/www/virtual/geeklab/html/ansiblelater_freeze /var/www/virtual/geeklab/ansible-later.geekdocs.de + username: + from_secret: ssh_username + +- name: publish + image: appleboy/drone-scp + settings: + host: + from_secret: ssh_host + key: + from_secret: ssh_key + rm: true + source: docs/public/* + strip_components: 2 + target: /var/www/virtual/geeklab/html/ansible-later.geekdocs.de/ + username: + from_secret: ssh_username + +- name: cleanup + image: appleboy/drone-ssh + settings: + host: + from_secret: ssh_host + key: + from_secret: ssh_key + script: + - ln -sfn /var/www/virtual/geeklab/html/ansible-later.geekdocs.de /var/www/virtual/geeklab/ansible-later.geekdocs.de + - rm -rf /var/www/virtual/geeklab/html/ansiblelater_freeze/ + username: + from_secret: ssh_username + +trigger: + ref: + - refs/heads/master + - refs/tags/** + +depends_on: +- build-package +- build-container-amd64 +- build-container-arm64 +- build-container-arm + --- kind: pipeline name: notifications @@ -393,7 +467,7 @@ steps: when: ref: - refs/heads/master - - "refs/tags/**" + - refs/tags/** - name: readme pull: always @@ -410,7 +484,7 @@ steps: when: ref: - refs/heads/master - - "refs/tags/**" + - refs/tags/** - name: microbadger pull: always @@ -439,19 +513,16 @@ steps: trigger: ref: - refs/heads/master - - "refs/tags/**" + - refs/tags/** status: - success - failure depends_on: -- build-package -- build-container-amd64 -- build-container-arm64 -- build-container-arm +- docs --- kind: signature -hmac: 825a77f8fb6f029b87bf463a2f2d670a8d0297f3cf17684787188362eba6a336 +hmac: 225363c3eddd299c7a3bdf2e54a2007e5ebc7e3881dd1aa0325e9f9ea7b2bc3b ... diff --git a/.gitignore b/.gitignore index 620329a..d55068e 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,9 @@ env*/ .pytest_cache pip-wheel-metadata + +# Hugo documentation +docs/themes/ +docs/public/ +resources/_gen/ + diff --git a/docs b/docs new file mode 160000 index 0000000..b9269e6 --- /dev/null +++ b/docs @@ -0,0 +1 @@ +Subproject commit b9269e6f5b1f5bcd3da3522c6c2e61f05ad0eebb