From 2f0ac6bb763b9089e2d1ea5a2bf78b21becd9c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonia=20P=C3=A9rez-Cerezo?= Date: Fri, 6 Sep 2024 11:16:54 +0200 Subject: [PATCH] Add post-receive sample hook --- README.md | 3 +++ scripts/post-receive.sample | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100755 scripts/post-receive.sample diff --git a/README.md b/README.md index 2de6f8c..273d5c4 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,9 @@ The `strecken.pmtiles` file is best generated using the possible using the `umap-extractor.py` script, which takes care of 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 The input data for `strecken.pmtiles` consists of a `data/` folder, diff --git a/scripts/post-receive.sample b/scripts/post-receive.sample new file mode 100755 index 0000000..8d3a6f0 --- /dev/null +++ b/scripts/post-receive.sample @@ -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