Skip to content

Commit

Permalink
namechange service pygeoapi_test to pygeoapi - test version via branc…
Browse files Browse the repository at this point in the history
…hing
  • Loading branch information
justb4 committed May 30, 2021
1 parent efe7997 commit 53b68a5
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#
name: pygeoapi test Deploy ⚙️

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

jobs:
main:
Expand All @@ -28,5 +28,5 @@ jobs:
inventory: ${{secrets.ANSIBLE_INVENTORY_PROD}}
vault_password: ${{secrets.ANSIBLE_VAULT_PASSWORD}}
options: |
--tags pygeoapi_test
--tags pygeoapi
--verbose
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![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)
[![pygeoapi Deploy](https://github.com/Geonovum/ogc-api-testbed/actions/workflows/deploy.pygeoapi.yml/badge.svg)](https://github.com/Geonovum/ogc-api-testbed/actions/workflows/deploy.pygeoapi.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)

Expand Down Expand Up @@ -53,15 +53,15 @@ The operational stack is composed with the following components:
When changes are pushed to this repo only the affected services are redeployed.
This is effected by a combination of GitHub Actions and Ansible Playbooks as follows:

* each Service has a dedicated GitHub Action "deploy" file, e.g. [deploy.pygeoapi_test.yml](.github/workflows/deploy.pygeoapi_test.yml)
* each Service has a dedicated GitHub Action "deploy" file, e.g. [deploy.pygeoapi.yml](.github/workflows/deploy.pygeoapi.yml)
* the GitHub Action "deploy" file contains a trigger for a `push` with a `paths` constraint, in this example:
```
on:
push:
paths:
- 'services/pygeoapi_test/**'
- 'services/pygeoapi/**'
```
* the GH Action then calls the Ansible Playbook [deploy.yml](ansible/deploy.yml) with a `--tags` option related to the Service, e.g. `--tags pygeoapi_test`
* the GH Action then calls the Ansible Playbook [deploy.yml](ansible/deploy.yml) with a `--tags` option related to the Service, e.g. `--tags pygeoapi`
* the [deploy.yml](ansible/deploy.yml) will always update the GH repo on the server VM via the `pre_tasks`
* the Ansible task indicated by the `tags` is then executed

Expand Down
2 changes: 1 addition & 1 deletion ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Deploy individual services:
```
ansible-playbook -v --vault-password-file ~/.ssh/ansible-vault/ogc-api-testbed.txt deploy.yml -i hosts/prod.yml --tags traefik
ansible-playbook -v --vault-password-file ~/.ssh/ansible-vault/ogc-api-testbed.txt deploy.yml -i hosts/prod.yml --tags pygeoapi_test
ansible-playbook -v --vault-password-file ~/.ssh/ansible-vault/ogc-api-testbed.txt deploy.yml -i hosts/prod.yml --tags pygeoapi
```
Expand Down
6 changes: 3 additions & 3 deletions ansible/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
shell: "cd {{ services_home }}/traefik && ./start.sh && docker ps"
tags: traefik

- name: "pygeoapi_test"
shell: "cd {{ services_home }}/pygeoapi_test && ./stop.sh && docker pull geopython/pygeoapi:latest && ./start.sh && docker ps"
tags: pygeoapi_test
- name: "pygeoapi"
shell: "cd {{ services_home }}/pygeoapi && ./stop.sh && docker pull geopython/pygeoapi:latest && ./start.sh && docker ps"
tags: pygeoapi

- name: "ldproxy"
shell: "cd {{ services_home }}/ldproxy && ./deploy.sh && docker ps"
Expand Down
2 changes: 1 addition & 1 deletion services/docs/src/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ for how this testbed is setup.

These are the services running on this domain.

* [pygeoapi test](/pygeoapi_test) - `pygeoapi` experimental
* [pygeoapi test](/pygeoapi) - `pygeoapi` experimental
* [ldproxy](/ldproxy) - `ldproxy`

## Links
Expand Down
3 changes: 0 additions & 3 deletions services/ldproxy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ services:
expose:
- "7080"

environment:
- SCRIPT_NAME=/ldproxy

volumes:
- ./data:/ldproxy/data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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.pygeoapi.yml)
* [Ansible Playbook](../../ansible/deploy.yml)

The Ansible Playbook can also be invoked directly.
45 changes: 45 additions & 0 deletions services/pygeoapi/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '3.3'

services:

pygeoapi:

image: geopython/pygeoapi:latest

container_name: pygeoapi

expose:
- "80"

# ports:
# - "5000:80"

environment:
- SCRIPT_NAME=/pygeoapi

volumes:
# Map data and config into pygeoapi container
- ./local.config.yml:/pygeoapi/local.config.yml
- ./data:/pygeoapi/data

labels:
# Enable Traefik routing on overlay service network
- "traefik.enable=true"
- "traefik.docker.network=service-network"

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

# local http router
- "traefik.http.routers.pygeoapi_http.rule=Host(`localhost`) && PathPrefix(`/pygeoapi`)"
- "traefik.http.routers.pygeoapi_http.entrypoints=http"

networks:
default:
external:
name: service-network
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ server:
bind:
host: 0.0.0.0
port: 80
url: https://oapi.map5.nl/pygeoapi_test
url: https://oapi.map5.nl/pygeoapi
mimetype: application/json; charset=UTF-8
encoding: utf-8
language: en-US
Expand Down
File renamed without changes.
File renamed without changes.
45 changes: 0 additions & 45 deletions services/pygeoapi_test/docker-compose.yml

This file was deleted.

0 comments on commit 53b68a5

Please sign in to comment.