build.sh/README.md

41 lines
1.5 KiB
Markdown
Raw Normal View History

2020-04-18 01:51:03 +00:00
# git-build.sh
2020-04-18 01:59:19 +00:00
Lightweight, KISS system to rebuild some git projects when they change.
# Setup
2020-04-18 04:00:33 +00:00
Simply place git-build.sh in your path. If you don't know where to put it, the script .git-build/git-build will put it in ~/bin/ and add the folder to your $PATH in ~/.bashrc.
2020-04-18 01:59:19 +00:00
# Usage
git-build.sh looks up your ~/.git-build/ folder to find stuff to build:
- config/ <-- additional settings/files for use in scripts
- PROJECT.source <-- URL to the git repo for PROJECT
- PROJECT.branch (optional) <-- branch to checkout
- PROJECT <-- script to execute when the project is updated
2020-04-18 04:00:33 +00:00
- PROJECT.log <-- STDOUT of PROJECT last run
- PROJECT.err <-- STDERR of PROJECT last run
2020-04-18 01:59:19 +00:00
Additionally, for each PROJECT a .PROJECT/ folder is created to clone the repository.
2020-04-18 04:00:33 +00:00
Note: the PROJECT script needs to be executable!
2020-04-18 01:59:19 +00:00
# Example
2020-04-18 04:00:33 +00:00
As an example on how to get started, this repo includes a .git-build/ folder. It's the configuration that generates [this site](https://thunix.net/~southerntofu/rfc) and keeps git-build.sh updated.
# Auto-update
Yes, you read that correctly. If you copy .git-build/git-build{,.source} to ~/.git-build/ git-build.sh will automatically be updated on each run.
You may not want to do that but i thought that was a nice proof of concept that the updater can update itself.
# Auto-execute
You need CRON for that. Additionally, i'm interested to run this script through a webhook endpoint for Github/Gitlab/Gitea webhooks.
# Contribute
Right now it seems to be working. If you find a bug please report it or open a merge request :)