linz / basemaps-config

Configuration for LINZ Basemaps
https://basemaps.linz.govt.nz
Other
5 stars 1 forks source link

ci: store a 'latest' assets file in AWS S3 BM-1094 #1008

Closed tawera-manaena closed 1 month ago

tawera-manaena commented 1 month ago

Motivation

As a Basemaps developer, having to look up the path to the most recent assets.tar.co file stored in AWS S3 is inconvenient. It would save me time and effort if a copy of the latest assets file were stored in a fixed location with a fixed name, similar to the bundled config file (config-latest.json.gz).

Context

When I run Basemaps locally, it's not always the case that I can run the basemaps/server package using the config-latest.json.gz file. For example, if I make changes to the vector tile stylesheets and want to test them locally, I need to bundle the config file myself. To do so, I have to specify the --assets parameter to enable fonts, glyphs, and sprites. Otherwise, they will not load on the map.

Solution

Currently, assets files are uploaded to AWS S3 with a hash suffix. Remembering such a hash is unrealistic. It would be ideal if there were an assets-latest.tar.co file stored within the /assets directory, similar to how a config-latest.json.gz file is stored within the /config directory.

s3://linz-basemaps/... Sorted by Last Modified
config/
assets/

Modifications

  1. Updated the build workflow so that it stores a copy of the current assets at the following location in AWS S3:
s3://linz-basemaps/assets/assets-latest.tar.co