site_update

Model for checking if a site has version control enabled.

Also implements the webhook to force a pull of new code from the version control system.

The URL for the webhook is:

https://yoursite.test/api/model/site_update/post/webhook/<token>

Where <token\> should be replaced with your configured token.

The token can be configured in the admin on System > Modules and then the config of the mod_site_update module.

The token is saved in the config key mod_site_update.webhook_token.

Available Model API Paths

MethodPath patternDescription
get/is_vcs_site/...Return whether the current site source directory resolves to a VCS checkout (.git, .hg, or symlinked checkout).
get/vcs_site/+site/...Return admin-only VCS tuple for site +site ({git|hg, Path}) or false when no repository is detected.
get/vcs_zotonic/...Return admin-only VCS tuple for the Zotonic core library directory ({git|hg, Path}) or false when not under VCS.
post/webhookRead webhook token from query arg token; if it matches mod_site_update.webhook_token, run VCS update (git pull/hg pull -u) for the current site. No further lookups.
post/webhook/+tokenUse path token +token; if it matches mod_site_update.webhook_token, run VCS update (git pull/hg pull -u) for the current site. No further lookups.

/+name marks a variable path segment. A trailing /... means extra path segments are accepted for further lookups.

Edit on GitHub