Go to file
Paul Liverman III 1968f5e88e Squashed 'applications/githook/' content from commit 853c905
git-subtree-dir: applications/githook
git-subtree-split: 853c905433ef1ecd7d9ea4b1f6fd6f73f28d7b20
2018-05-11 13:51:27 -07:00
models Squashed 'applications/githook/' content from commit 853c905 2018-05-11 13:51:27 -07:00
views Squashed 'applications/githook/' content from commit 853c905 2018-05-11 13:51:27 -07:00
.gitignore Squashed 'applications/githook/' content from commit 853c905 2018-05-11 13:51:27 -07:00
githook.moon Squashed 'applications/githook/' content from commit 853c905 2018-05-11 13:51:27 -07:00
LICENSE Squashed 'applications/githook/' content from commit 853c905 2018-05-11 13:51:27 -07:00
migrations.moon Squashed 'applications/githook/' content from commit 853c905 2018-05-11 13:51:27 -07:00
ReadMe.md Squashed 'applications/githook/' content from commit 853c905 2018-05-11 13:51:27 -07: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.