This repository has been archived by the owner on Dec 8, 2017. It is now read-only.
This repository has been archived by the owner on Dec 8, 2017. It is now read-only.
Open
Description
After the refactoring I'm about to do to support #20, I'll be able to add the ability to auto-update the guides_style_18f
gems, or any arbitrary theme package. Initial thoughts on how I'm thinking it'll come together:
- New configuration variables:
defaultThemeUpdater
object withrepoName
,updateCommand
,waitDelay
, andmaxRetries
for the top-level config- The delay is necessary because release tags are often pushed before their corresponding packages, but should be something reasonably small, like 10000ms
- the default command should be
bundle update --source guides_style_18f && bundle install
in our case
- optional
themeUpdater
object for specific builders withrepo
andupdateCommand
properties
- On startup, scan every repo for
.18f.pages.yml
files and find anytheme_repo:
andtheme_update:
properties- Skip any repo with an
auto_update_theme: false
property
- Skip any repo with an
- Create a
ThemeUpdater
class, which will:- take this list and create a mapping from theme repo names to
repoName, updateCommand
arrays - Use GitHub's PubSubHubBub API to subscribe to
create
events from all theme repos, so new releases can be identified by new tags - Update the mapping every time a site is rebuilt, as part of
.18f-pages.yml
processing
- take this list and create a mapping from theme repo names to
- When a theme update event comes in, the
ThemeUpdater
will:- wait for
waitDelay
milliseconds - launch the following operations for each repository in parallel, up to
maxRetries
times each:- grab the update lock (already implemented in
SiteBuilder
usingfile-locked-operation
) - run the theme update command; if successful, rebuild the site
- if unsuccessful, log the error, increment the retry count, wait and try again
- if the rebuild is successful, do a
git add && git commit -m 'Updated theme to <TAG-NAME> && git push
- if the rebuild isn't successful, log the event and remove the repo from the
ThemeUpdater
mapping, as this may signal an incompatible update
- if the rebuild isn't successful, log the event and remove the repo from the
- grab the update lock (already implemented in
- wait for
Metadata
Assignees
Labels
No labels