Repository navigation
Description
Until this week, the process of deploying updates to our map styles into the Rails application has been tedious and manual.
@Rub21 wrote a script to make it less so:
https://github.com/OpenHistoricalMap/ohm-deploy/blob/main/images/web/update_map_styles.py
This is a huge improvement, but there's one more part of the process:
The stylesheets reference spritesheets and glyphs that live on the map-styles repo in these lines:
- https://github.com/OpenHistoricalMap/map-styles/blob/staging/ohm_timeslider_tegola/tegola-ohm.json#L28-L29
- https://github.com/OpenHistoricalMap/map-styles/blob/staging/rail/rail.json#L26-L27
- https://github.com/OpenHistoricalMap/map-styles/blob/staging/japanese_scroll/ohm-japanese-scroll-map.json#L15-L16
- https://github.com/OpenHistoricalMap/map-styles/blob/staging/woodblock/woodblock.json#L15-L16
For the main OHM style, we had an issue long ago where we were editing the spritesheet to test style updates, and that was breaking the live production map. As a stopgap we made this script that simply copies the style json and spritesheets into _production versions and then we reference those in the tegola style:
https://github.com/OpenHistoricalMap/map-styles/blob/staging/ohm_timeslider_tegola/make_production_version.py
To build on the improved deployment method Ruben has developed, I propose the following changes:
- Rename
ohm_timeslider_tegolatomain.jsonin themap-stylesrepo and the relevant files onohm-website. This will make it more obvious what the file is for. - Script the copy of spritesheets for each style into ohm-website so we're not live-linking to anything on
map-stylesGithub Pages site. - Replace the references to those in the deployed ohm-website JSON stylesheets
- Remove documentation at https://github.com/OpenHistoricalMap/map-styles/blob/staging/ohm_timeslider_tegola/README.md
- Document a method to test the style deploy script locally in the
ohm-websitelocal dev environment, so we can actually debug the latest styles there. - Clean up
ohm-style.*JS files in theohm-websiterepo to remove unneeded files and disused Javascript. May need updates to other JS files or HTML templates that call JS files? - Clean up
map-stylesrepo to remove extra_productionfiles and other cruft - Update the README at https://github.com/OpenHistoricalMap/map-styles/blob/staging/README.md with documentation of how the map style changes get deployed.
UPDATED: We rarely chang efonts, so we could leave the fonts as is in map-styles repo and just copy over the spritesheets.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Production
Activity
Renaming key files and cleaning out unneeded stuff
danrademacher commentedon May 24, 2024
Changes to
map-stylesare in a PR ready for review by @vknoppkewetzel and @tsinn. But before we merge that we have to remove the dependency on the spritesheet served out ofmap-stylesor we will break the map on the live site.Minor map style cleanup for better deploy
danrademacher commentedon May 24, 2024
Changes on the website code ended up being very minor -- keep the base style ERB since it still loads Maplibre RTL plugin (see OpenHistoricalMap/ohm-website#247)
So I think what's left is these steps:
map-stylesrepo.main/main.jsoninstead ofohm_timeslider_tegola/ohm_timeslider_tegola_production.jsonand associated spritesheets.Rub21 commentedon Jun 4, 2024
@danrademacher could you check the progress is here OpenHistoricalMap/ohm-deploy#327, it is ready to go to production.
danrademacher commentedon Jun 4, 2024
Ok, just confirmed that all spritesheets are coming from staging.openhisotircalmap.org on staging:

hmm. now we have merge conflicts on the map-styles between this WIP PR OpenHistoricalMap/map-styles#29 and the latest map styles. So I'll need to resolve those and merge to get latest map style code into main branch before we deploy this to production.
Update map styles
danrademacher commentedon Jun 4, 2024
@Rub21 I merged the changes in
map-stylesand this new PR should be ready to merge to staging:OpenHistoricalMap/ohm-deploy#328
If that works, then this is good for production
2 remaining items
Rub21 commentedon Jun 4, 2024
nice, so this is ready to go production!
Rub21 commentedon Jun 4, 2024
The changes are already in production : https://www.openhistoricalmap.org/
Fix to style reference
Fix overpass turbo map style name
1ec5 commentedon Jun 6, 2024
Oh, there’s more…
There’s no telling how many people followed the documentation to hard-code the old URL. But I’m glad we’ve simplified the URL to something that makes more sense.
danrademacher commentedon Jun 6, 2024
Oy, OK, hard lesson learned here. As a stop gap, I could make a copy of the main map style and spritesheet under the old name. Then roll this out more thoughtfully.
1ec5 commentedon Jun 6, 2024
I’m not sure there’s a great solution. Copying the file would erase the file’s edit history, so it would be more difficult to track down regressions in the future. I wonder if GitHub Pages supports any kind of rewrite rule or symbolic link that would let us keep a redirect around. Anyways, “main” is a good enough name; no need to overthink it right now.
Rub21 commentedon Nov 5, 2024
Can we close this ticket?
danrademacher commentedon Nov 5, 2024
We still have one open task here:
I don't quite remember right now if we ever had a method to locally pull in the latest map styles for testing. I think that's still copy-paste by hand. Actually, I'm make a new ticket for just that bit.