Skip to content

Commit

Permalink
#8 first working version docs service w redeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
justb4 committed May 25, 2021
1 parent 53db571 commit 6683724
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 11 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/deploy.docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Ansible workflow for single service deployment.
# Uses: https://github.com/dawidd6/action-ansible-playbook
# Options: https://github.com/dawidd6/action-ansible-playbook/blob/master/main.js
# Author: Just van den Broecke - 2021
#
name: Docs Deploy ⚙️

# Trigger only when services/docs subdir changed
on:
push:
paths:
- 'services/docs/**'

jobs:
main:
runs-on: ubuntu-20.04

steps:
- name: Checkout ✅
uses: actions/checkout@v2

- name: Run playbook ⚙
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: deploy.yml
directory: ./ansible
key: ${{secrets.ANSIBLE_SSH_PRIVATE_KEY}}
inventory: ${{secrets.ANSIBLE_INVENTORY_PROD}}
vault_password: ${{secrets.ANSIBLE_VAULT_PASSWORD}}
options: |
--tags docs
--verbose
2 changes: 1 addition & 1 deletion .github/workflows/deploy.pygeoapi_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
name: pygeoapi test Deploy ⚙️

# Trigger only when service/traefik subdir changed
# Trigger only when services/pygeoapi_test subdir changed
on:
push:
paths:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
name: Traefik Deploy ⚙️

# Trigger only when service/traefik subdir changed
# Trigger only when services/traefik subdir changed
on:
push:
paths:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Traefik Deploy](https://github.com/Geonovum/ogc-api-testbed/actions/workflows/deploy.traefik.yml/badge.svg)](https://github.com/Geonovum/ogc-api-testbed/actions/workflows/deploy.traefik.yml)
[![pygeoapi_test Deploy](https://github.com/Geonovum/ogc-api-testbed/actions/workflows/deploy.pygeoapi_test.yml/badge.svg)](https://github.com/Geonovum/ogc-api-testbed/actions/workflows/deploy.pygeoapi_test.yml)
[![docs Deploy](https://github.com/Geonovum/ogc-api-testbed/actions/workflows/deploy.docs.yml/badge.svg)](https://github.com/Geonovum/ogc-api-testbed/actions/workflows/deploy.docs.yml)
[![Gitter](https://img.shields.io/gitter/room/Geonovum/ogc-api-testbed.svg?style=flat-square)](https://gitter.im/Geonovum/ogc-api-testbed)

# OGC API Testbed
Expand Down Expand Up @@ -39,7 +40,7 @@ The operational stack is composed with the following components:
* [Traefik](https://traefik.io/) a frontend proxy/load-balancer and SSL (HTTPS) endpoint.
* [pygeoapi](https://pygeoapi.io/) a Python server implementation of the OGC API suite of standards.
* to be determined: [GeoServer](http://geoserver.org/), [ldproxy](https://interactive-instruments.github.io/ldproxy/), ...
* [mkdocs](https://www.mkdocs.org/) for live documentation
* [mkdocs](https://www.mkdocs.org/) for website and live documentation
* both an experimental and stable stack instance is available

The above setup has been used with success in several projects like
Expand Down
4 changes: 4 additions & 0 deletions ansible/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@
- name: "pygeoapi_test"
shell: "cd {{ services_home }}/pygeoapi_test && ./stop.sh && docker pull geopython/pygeoapi:latest && ./start.sh && docker ps"
tags: pygeoapi_test

- name: "docs"
shell: "cd {{ services_home }}/docs && ./deploy.sh && docker ps"
tags: docs
2 changes: 1 addition & 1 deletion services/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ WORKDIR /docs/

EXPOSE 8000

CMD ["mkdocs", "serve"]
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
8 changes: 3 additions & 5 deletions services/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Demo service for pygeoapi - test
# Docs

Runs latest GitHub `main` branch of `pygeoapi` using
its [Docker Image from DockerHub](https://cloud.docker.com/u/geopython/repository/docker/geopython/pygeoapi).
with a [local config file](local.config.yml).
Runs main website, landing page, using mkdocs.

## Deployment

Expand All @@ -12,7 +10,7 @@ when committed/pushed.
A GitHub Action invokes an Ansible Playbook.
See the following deployment files:

* [GitHub Action](../../.github/workflows/deploy.pygeoapi_test.yml)
* [GitHub Action](../../.github/workflows/deploy.docs.yml)
* [Ansible Playbook](../../ansible/deploy.yml)

The Ansible Playbook can also be invoked directly.
4 changes: 2 additions & 2 deletions services/docs/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ services:
- "traefik.docker.network=service-network"

# SSL/https router
- "traefik.http.routers.docs_https.rule=Host(`${TRAEFIK_SSL_DOMAIN}`) && PathPrefix(`/docs`)"
- "traefik.http.routers.docs_https.rule=Host(`${TRAEFIK_SSL_DOMAIN}`)"
- "traefik.http.routers.docs_https.entrypoints=https"
- "traefik.http.routers.docs_https.tls=${TRAEFIK_USE_TLS}"
- "traefik.http.routers.docs_https.tls.certresolver=${TRAEFIK_SSL_CERT_RESOLVER}"
- "traefik.http.routers.docs_https.tls.options=my_default@file"
- "traefik.http.routers.docs_https.middlewares=secure-headers@file"

# local http router
- "traefik.http.routers.docs_http.rule=Host(`localhost`) && PathPrefixStrip(`/docs`)"
- "traefik.http.routers.docs_http.rule=Host(`localhost`)"
- "traefik.http.routers.docs_http.entrypoints=http"

networks:
Expand Down

0 comments on commit 6683724

Please sign in to comment.