Add post-receive sample hook

This commit is contained in:
Antonia 2024-09-06 11:16:54 +02:00
parent 9d53c7d292
commit 2f0ac6bb76
2 changed files with 11 additions and 0 deletions

View file

@ -31,6 +31,9 @@ The `strecken.pmtiles` file is best generated using the
possible using the `umap-extractor.py` script, which takes care of possible using the `umap-extractor.py` script, which takes care of
exporting the data as well as the graphical style for each layer. exporting the data as well as the graphical style for each layer.
A sample git `post-receive` hook is provided to build and deploy the
map when the map data is pushed.
### Input Data ### Input Data
The input data for `strecken.pmtiles` consists of a `data/` folder, The input data for `strecken.pmtiles` consists of a `data/` folder,

8
scripts/post-receive.sample Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
temp=$(mktemp -d)
outdir=/var/www/html/$(basename $(pwd))
mkdir -p $outdir
git --work-tree=$temp --git-dir=$GIT_DIR checkout -f
~/scripts/mapbuilder.sh $temp $outdir
cp $temp/layers.json $outdir
rm -r $temp