A simple hook receiver to update a Lapis-powered website.
Go to file
2018-05-11 13:49:25 -07:00
models re-initialization 2018-03-04 11:44:42 -08:00
views re-initialization 2018-03-04 11:44:42 -08:00
.gitignore re-initialization 2018-03-04 11:44:42 -08:00
githook.moon close #10, logs prettier 2018-05-11 13:49:25 -07:00
LICENSE re-initialization 2018-03-04 11:44:42 -08:00
migrations.moon re-initialization 2018-03-04 11:44:42 -08:00
ReadMe.md re-initialization 2018-03-04 11:44:42 -08:00

Installation

(Note: I'm going to rewrite this to explain how to use with locator, a simple server locator I designed for use with Lapis and these sub-applications.)

Dependencies:

  • Lapis (duh)
  • MoonScript
  • OpenResty user needs a bash shell (ch -s /bin/bash user)

From the shell:

git subtree add --prefix githook https://github.com/lazuscripts/githook.git master --squash

(--prefix specifies where it will be saved.)

Alternately, you can add it as a remote for easier maintenance:

git remote add -f githook https://github.com/lazuscripts/githook.git
git subtree add --prefix githook githook master --squash

From your main application class: @include "githook.githook" (or wherever you put it)

Updating

From the shell:

git subtree pull --prefix githook https://github.com/lazuscripts/githook.git master --squash

Or, if it is set up as remote:

git subtree pull --prefix githook githook master --squash

Config

All configuration is optional. Without configuration, will attempt to update any time it is visited.

  • githook_branch "branch" which branch you want updating (as string) (to prevent updates triggering when pushing unrelated branches)
  • githook_secret "secret" the secret string used on GitHub

Will attempt to checkout, pull, update submodules if needed, compile all code, then run migrations, and finally update the running server without interruption.

Returns a log along with exit codes on success or failure.