Skip to content

Improve map style deployment process #792

Closed

Description

@danrademacher

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:

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:

UPDATED: We rarely chang efonts, so we could leave the fonts as is in map-styles repo and just copy over the spritesheets.

Activity

  1. added
    infrastructure
    on May 24, 2024
  2. danrademacher commented on May 24, 2024

    @danrademacher
    Author

    Changes to map-styles are 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 of map-styles or we will break the map on the live site.

  3. danrademacher commented on May 24, 2024

    @danrademacher
    Author

    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:

    1. Update the deploy script to also copy over the spritesheets.
    2. Deploy that once to remove live dependencies on spritesheets from map-styles repo.
    3. Then merge Renaming key files and cleaning out unneeded stuff map-styles#29
    4. Update the deploy script to target main/main.json instead of ohm_timeslider_tegola/ohm_timeslider_tegola_production.json and associated spritesheets.
    5. Deploy that
    6. Update the documentation in the map-style repo for how all this works.
  4. moved this from In Progress to On Staging in OpenHistoricalMap Dev Planningon Jun 3, 2024
  5. Rub21 commented on Jun 4, 2024

    @Rub21
    Member

    @danrademacher could you check the progress is here OpenHistoricalMap/ohm-deploy#327, it is ready to go to production.

  6. danrademacher commented on Jun 4, 2024

    @danrademacher
    Author

    Ok, just confirmed that all spritesheets are coming from staging.openhisotircalmap.org on staging:
    image

    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.

  7. added a commit that references this issue on Jun 4, 2024
  8. danrademacher commented on Jun 4, 2024

    @danrademacher
    Author

    @Rub21 I merged the changes in map-styles and this new PR should be ready to merge to staging:
    OpenHistoricalMap/ohm-deploy#328

    If that works, then this is good for production

  9. 2 remaining items

  10. Rub21 commented on Jun 4, 2024

    @Rub21
    Member

    nice, so this is ready to go production!

  11. Rub21 commented on Jun 4, 2024

    @Rub21
    Member
  12. 1ec5 commented on Jun 6, 2024

    @1ec5
    Member

    That's the one place we were pulling the stylehseet live!

    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.

  13. danrademacher commented on Jun 6, 2024

    @danrademacher
    Author

    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.

  14. 1ec5 commented on Jun 6, 2024

    @1ec5
    Member

    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.

  15. moved this from On Staging to Todo - Known Path in OpenHistoricalMap Dev Planningon Jul 11, 2024
  16. moved this from Todo - Known Path to Done in OpenHistoricalMap Dev Planningon Nov 5, 2024
  17. Rub21 commented on Nov 5, 2024

    @Rub21
    Member

    Can we close this ticket?

  18. danrademacher commented on Nov 5, 2024

    @danrademacher
    Author

    We still have one open task here:

    • Document a method to test the style deploy script locally in the ohm-website local dev environment, so we can actually debug the latest styles there.

    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.

  19. added theissue type on Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

infrastructurestylesheets

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions