diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-03 11:45:36 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-03 11:45:36 +1000 |
commit | 6f29aa3e590a77870ed8d857ccdac01009fae0c1 (patch) | |
tree | 7a87647515b49bbfc54c7879642a572a8037d01a | |
parent | 32a78fde0bc80d6b38b647942462ac12d4c64419 (diff) |
use prepare job which saves results in cache to skip lengthy geojson stage
-rw-r--r-- | .gitlab-ci.yml | 30 | ||||
-rw-r--r-- | Makefile | 16 |
2 files changed, 41 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2476dd9..0cf08ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,20 @@ image: "debian:buster-slim" +cache: + key: global + paths: + - .yarn + - node_modules + - data/vicmap.geojson + stages: + - prepare - build -build: - stage: build +prepare: + stage: prepare + cache: + policy: push script: - apt-get update && apt-get install -y curl gnupg gdal-bin unzip wget make - curl -fsSL https://deb.nodesource.com/setup_12.x | bash - @@ -13,9 +23,23 @@ build: - apt-get update && apt-get install -y yarn nodejs - yarn install - mkdir -p dist - - make data/VICMAP_ADDRESS.zip unzip - make data/vicmap.geojson + when: manual + +build: + stage: build + cache: + policy: pull + script: + - apt-get update && apt-get install -y curl gnupg make + - curl -fsSL https://deb.nodesource.com/setup_12.x | bash - + - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - + - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list + - apt-get update && apt-get install -y yarn nodejs + - yarn install + - mkdir -p dist - make dist/vicmap-osm.geojson + - make dist/vicmap-osm-flats.geojson artifacts: name: "build" paths: @@ -5,9 +5,21 @@ data/VICMAP_ADDRESS.zip: mkdir -p data wget --no-verbose --directory-prefix=data https://www.alantgeo.com.au/share/VICMAP_ADDRESS.zip -unzip: data/VICMAP_ADDRESS.zip +# cadastre used for debugging +data/VICMAP_PROPERTY.zip: + mkdir -p data + wget --no-verbose --directory-prefix=data https://www.alantgeo.com.au/share/VICMAP_PROPERTY.zip + +data/vicmap/ll_gda94/sde_shape/whole/VIC/VMADD/layer/address.shp: data/VICMAP_ADDRESS.zip + mkdir -p data/vicmap + unzip -d data/vicmap -n $< + +data/vicmap/ll_gda94/sde_shape/whole/VIC/VMPROP/layer/property_view.shp: data/VICMAP_PROPERTY.zip mkdir -p data/vicmap - unzip -d data/vicmap $< + unzip -d data/vicmap -n $< + +data/vicmap-property.fgb: data/vicmap/ll_gda94/sde_shape/whole/VIC/VMPROP/layer/property_view.shp + ogr2ogr -f FlatGeobuf $@ $< data/vicmap.geojson: data/vicmap/ll_gda94/sde_shape/whole/VIC/VMADD/layer/address.shp ogr2ogr -f GeoJSONSeq $@ $< |