~jcc/hugo-site

ab46ff31c052df514f9cdae3704a534f3e24d90c — Jason Cox 2 months ago e9f4b4f
Update git-personal-builder docs for gpb-docker
1 files changed, 5 insertions(+), 3 deletions(-)

M content/creations/git-personal-builder.md
M content/creations/git-personal-builder.md => content/creations/git-personal-builder.md +5 -3
@@ 1,7 1,7 @@
---
title: git-personal-builder
date: 2022-11-21
lastmod: 2022-11-22
lastmod: 2024-06-25
code:
    git: https://git.sr.ht/~jcc/git-personal-builder
    contributing:


@@ 9,8 9,10 @@ code:
        mailing_list: https://lists.sr.ht/~jcc/public-inbox
---

A base Docker image for creating build sidecars for [git-personal](/creations/git-personal/). These sidecars allow git-personal to trigger a build every time new code is pushed. For example, I use git-personal-builder to [auto-deploy my website](https://git.sr.ht/~jcc/hugo-site/tree/master/build/Dockerfile) and to [auto-publish its own Docker image](https://git.sr.ht/~jcc/git-personal-builder/tree/master/build/Dockerfile).
A base Docker image for creating build sidecars for [git-personal](/creations/git-personal/). These sidecars allow git-personal to trigger a build every time new code is pushed.

<!--more-->

git-personal-builder runs a super simple HTTP server listening for `POST /build` requests from git-personal. These requests include the hash of the commit being built, any tags associated with the commit, and a `tar.gz` archive of the code at that commit. The server extracts the code archive into a directory and then calls a build command with the hash, directory, and tags as arguments. This build command is supplied by the image created on top of the git-personal-builder image -- check out the examples linked above to see how it is used in practice.
git-personal-builder runs a super simple HTTP server listening for `POST /build` requests from git-personal. These requests include the hash of the commit being built, any branches and tags associated with the commit, relevant secrets, and a `tar.gz` archive of the code at that commit. The server extracts the code archive into a directory, saves the secrets into another directory, and then calls a build command with the hash, directory, secrets directory, and branches/tags as arguments. This build command is supplied by the image created on top of the git-personal-builder image.

I primarily use git-personal-builder via the included [gpb-docker](https://git.sr.ht/~jcc/git-personal-builder/tree/master/gpb-docker/README.md) image. gpb-docker is a generic builder image built on top of the base git-personal-image. It allows for flexible builds defined in the repository being built, and a single gpb-docker container can be used to run multiple builds for the same repo or to build many different repos. For example, I use a single gpb-docker container to [auto-deploy my website](https://git.sr.ht/~jcc/hugo-site/tree/master/.gpb-docker.json), to [auto-publish git-personal's Docker image](https://git.sr.ht/~jcc/git-personal/tree/master/.gpb-docker.json), and to [auto-publish the Docker images for git-personal-builder and gpb-docker](https://git.sr.ht/~jcc/git-personal-builder/tree/master/.gpb-docker.json).