From 6f29aa3e590a77870ed8d857ccdac01009fae0c1 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Mon, 3 May 2021 11:45:36 +1000 Subject: use prepare job which saves results in cache to skip lengthy geojson stage --- .gitlab-ci.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to '.gitlab-ci.yml') 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: -- cgit v1.2.3