From a2096959497257c133d52bd39837f6a6982b4385 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 15 Mar 2023 10:12:30 +0100 Subject: [PATCH] Better doc --- .gitignore | 1 + README.md | 43 +++++++++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f491ecd --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +albatros diff --git a/README.md b/README.md index 4f86a66..ee7d0ef 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,34 @@ $ curl http://localhost:8080/build?job=builder%2Fdispatch-1678866433-15aad86a Of course, most of that will be handled by Gitea. +## Writing your build script + +You must create an executable `.albatros` file at the root of your repository. +Then, you can use the interpreter you want to execute it, let use `bash` +as an example, but please use python, javascript, or anything else that has +proper error handling... + +```bash +#!/usr/bin/env bash +echo "Building commit $COMMIT" +go build +``` + +During the build, the following environment variables are available: + +```bash +REPO_URL=https://git.deuxfleurs.fr/quentin/albatros.git +COMMIT=3fff73597f8ca18ef04c0d9bf64132ba55aadcaa +BRANCH=main +FLAVOR=default +SECRET1=xxx +SECRET2=xxx +``` + +## Registering a webhook in Gitea + +*Todo* + ## Security model Albatros only tries to protect your secrets. @@ -99,20 +127,7 @@ read the content of your environment variable. It should not be that hard, containers use PID namespace by default, so one containerized process can not access process information of other processes in the system. -## Writing your build script - -The following variables will be - -```bash -REPO_URL=https://git.deuxfleurs.fr/quentin/albatros.git -COMMIT=3fff73597f8ca18ef04c0d9bf64132ba55aadcaa -BRANCH=main -FLAVOR=default -SECRET1=xxx -SECRET2=xxx -``` - ## Ideas - [ ] Register the builder programatically -- [ ] Allow user to define it's own set of builders (ones with more CPU+RAM, etc.) +- [ ] Allow users to define their own set of builders (ones with more CPU+RAM, etc.)