mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2025-08-16 16:41:38 +00:00
Added test for installing from distribution packages (#330)
In order to ensure that the instructions contained within `README.rst` also work when installing `mod_tile` packages from `Debian`/`Ubuntu` repositories, I have added a basic test which first installs those packages and then executes the same commands from the aforementioned instructions. Here is an example of a workflow run: https://github.com/hummeltech/mod_tile/actions/runs/5638547864 **Also:** * Add additional image format types into example configuration instructions in `README.rst` * Which are already referenced in [utils/example-map/index.html](https://github.com/openstreetmap/mod_tile/blob/master/utils/example-map/index.html#L28-L39) * Add step in `README.rst` to ensure `/var/run/renderd` exists
This commit is contained in:
78
.github/workflows/install-package-and-test.yml
vendored
Normal file
78
.github/workflows/install-package-and-test.yml
vendored
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
---
|
||||||
|
name: Install Package & Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
install-package-and-test:
|
||||||
|
name: ${{ matrix.image }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
image:
|
||||||
|
- "debian:11"
|
||||||
|
- "debian:12"
|
||||||
|
- "ubuntu:22.04"
|
||||||
|
fail-fast: false
|
||||||
|
container:
|
||||||
|
image: ${{ matrix.image }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install mod_tile & renderd
|
||||||
|
uses: ./.github/actions/dependencies/install/apt-get
|
||||||
|
with:
|
||||||
|
packages: >-
|
||||||
|
apache2
|
||||||
|
curl
|
||||||
|
libapache2-mod-tile
|
||||||
|
renderd
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
run: |
|
||||||
|
mkdir -p /usr/share/renderd
|
||||||
|
cp -av utils/example-map /usr/share/renderd/
|
||||||
|
cp -av etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf
|
||||||
|
printf '
|
||||||
|
[example-map]
|
||||||
|
URI=/tiles/renderd-example
|
||||||
|
XML=/usr/share/renderd/example-map/mapnik.xml
|
||||||
|
|
||||||
|
[example-map-jpg]
|
||||||
|
TYPE=jpg image/jpeg jpeg
|
||||||
|
URI=/tiles/renderd-example-jpg
|
||||||
|
XML=/usr/share/renderd/example-map/mapnik.xml
|
||||||
|
|
||||||
|
[example-map-png256]
|
||||||
|
TYPE=png image/png png256
|
||||||
|
URI=/tiles/renderd-example-png256
|
||||||
|
XML=/usr/share/renderd/example-map/mapnik.xml
|
||||||
|
|
||||||
|
[example-map-png32]
|
||||||
|
TYPE=png image/png png32
|
||||||
|
URI=/tiles/renderd-example-png32
|
||||||
|
XML=/usr/share/renderd/example-map/mapnik.xml
|
||||||
|
|
||||||
|
[example-map-webp]
|
||||||
|
TYPE=webp image/webp webp
|
||||||
|
URI=/tiles/renderd-example-webp
|
||||||
|
XML=/usr/share/renderd/example-map/mapnik.xml
|
||||||
|
' | tee -a /etc/renderd.conf
|
||||||
|
mkdir -p /var/run/renderd
|
||||||
|
renderd
|
||||||
|
a2enmod tile
|
||||||
|
a2ensite renderd-example-map
|
||||||
|
apache2ctl restart
|
||||||
|
shell: bash --noprofile --norc -euxo pipefail {0}
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
until $(curl --fail --output tile.png --silent http://localhost:8081/tiles/renderd-example/9/297/191.png); do
|
||||||
|
echo 'Sleeping 5s';
|
||||||
|
sleep 5;
|
||||||
|
done
|
||||||
|
echo 'dbf26531286e844a3a9735cdd193598dca78d22f77cafe5824bcaf17f88cbb08 tile.png' | sha256sum --check
|
||||||
|
shell: bash --noprofile --norc -euxo pipefail {0}
|
||||||
|
timeout-minutes: 1
|
30
README.rst
30
README.rst
@ -98,7 +98,7 @@ Copy the apache configuration file to its place, too:
|
|||||||
|
|
||||||
$ sudo cp -av etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf
|
$ sudo cp -av etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf
|
||||||
|
|
||||||
Add a map configuration for example-map to ``/etc/renderd.conf`:
|
Add map configurations for example-map to ``/etc/renderd.conf``:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
@ -106,9 +106,35 @@ Add a map configuration for example-map to ``/etc/renderd.conf`:
|
|||||||
[example-map]
|
[example-map]
|
||||||
URI=/tiles/renderd-example
|
URI=/tiles/renderd-example
|
||||||
XML=/usr/share/renderd/example-map/mapnik.xml
|
XML=/usr/share/renderd/example-map/mapnik.xml
|
||||||
|
|
||||||
|
[example-map-jpg]
|
||||||
|
TYPE=jpg image/jpeg jpeg
|
||||||
|
URI=/tiles/renderd-example-jpg
|
||||||
|
XML=/usr/share/renderd/example-map/mapnik.xml
|
||||||
|
|
||||||
|
[example-map-png256]
|
||||||
|
TYPE=png image/png png256
|
||||||
|
URI=/tiles/renderd-example-png256
|
||||||
|
XML=/usr/share/renderd/example-map/mapnik.xml
|
||||||
|
|
||||||
|
[example-map-png32]
|
||||||
|
TYPE=png image/png png32
|
||||||
|
URI=/tiles/renderd-example-png32
|
||||||
|
XML=/usr/share/renderd/example-map/mapnik.xml
|
||||||
|
|
||||||
|
[example-map-webp]
|
||||||
|
TYPE=webp image/webp webp
|
||||||
|
URI=/tiles/renderd-example-webp
|
||||||
|
XML=/usr/share/renderd/example-map/mapnik.xml
|
||||||
' | sudo tee -a /etc/renderd.conf
|
' | sudo tee -a /etc/renderd.conf
|
||||||
|
|
||||||
Start the rendering daemon
|
Ensure the ``/var/run/renderd`` directory exists:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
$ sudo mkdir -p /var/run/renderd
|
||||||
|
|
||||||
|
Start the rendering daemon:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user