southerntofu 265fae11fe | ||
---|---|---|
.git-build | ||
.gitignore | ||
LICENSE | ||
README.md | ||
git-build.sh |
README.md
git-build.sh
Lightweight, KISS system to rebuild some git projects when they change.
Setup
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.
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
- PROJECT.log <-- STDOUT of PROJECT last run
- PROJECT.err <-- STDERR of PROJECT last run
Additionally, for each PROJECT a .PROJECT/ folder is created to clone the repository.
To clone/update your repo and start your build scripts, start the git-build.sh command.
Note: the PROJECT script needs to be executable!
Example
As an example on how to get started, this repo includes a .git-build/ folder. It's the configuration that generates this site 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 :)