From dd7d7792d17a91b4b5ed5e4d16c4948eb623a73d Mon Sep 17 00:00:00 2001 From: nkraetzschmar <9020053+nkraetzschmar@users.noreply.github.com> Date: Mon, 26 Jun 2023 10:03:34 +0200 Subject: [PATCH 1/2] Revert "adding instructions to contribute. removing builder-build from build file" This reverts commit 796daaf27c93e1cb79d9162bd7c5f0f7f10526fd. --- README.md | 12 ------------ build | 5 +++++ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d972f1a..421874e 100644 --- a/README.md +++ b/README.md @@ -43,15 +43,3 @@ In addition to the above components, your configuration directory must include t If you're new to configuring the Builder, you can find a minimal example config directory at [gardenlinux/builder_example](https://github.com/gardenlinux/builder_example). For a more comprehensive example, refer to the main [gardenlinux](https://github.com/gardenlinux/gardenlinux) repository. Feel free to explore these examples to gain a better understanding of how to effectively structure your own config directory. - - -## Contribute - -If you like to modify the *Garden Linux Builder*, make your changes and create a new builder container by simply building the root folder with docker or podman: - - sudo podman build -t localhost/builder . - - # or - - docker build -t localhost/builder . - diff --git a/build b/build index d63960c..6314e74 100755 --- a/build +++ b/build @@ -58,6 +58,11 @@ container_mount_opts=( -v "$(realpath "$target_dir"):/builder/.build" ) +if [ "$container_image" = localhost/builder ]; then + dir="$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")" + "$container_engine" build -t "$container_image" "$dir" +fi + repo="$(./get_repo)" commit="$(./get_commit)" timestamp="$(./get_timestamp)" From 66d504ff157b0755e852b67390dbd559ed2e4007 Mon Sep 17 00:00:00 2001 From: nkraetzschmar <9020053+nkraetzschmar@users.noreply.github.com> Date: Mon, 26 Jun 2023 10:13:23 +0200 Subject: [PATCH 2/2] add local dev documentation --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 421874e..f19ca34 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,17 @@ In addition to the above components, your configuration directory must include t If you're new to configuring the Builder, you can find a minimal example config directory at [gardenlinux/builder_example](https://github.com/gardenlinux/builder_example). For a more comprehensive example, refer to the main [gardenlinux](https://github.com/gardenlinux/gardenlinux) repository. Feel free to explore these examples to gain a better understanding of how to effectively structure your own config directory. + + +## Local Development + +To test changes made to the builder locally you can simply create a symlink to the build script inside the builder directory inside a config directory. This will automatically be detected by the build script and the builder re-build iff necessary. + +e.g.: if you have the gardenlinux and builder repos both inside the same parent directory and you want to work on the builder you would do the following: + +``` +cd gardenlinux +ln -f -s ../builder/build build +``` + +Now you can make your modifications inside the builder directory and running `./build ${target}` inside the gardenlinux repo will use the local builder, rebuilding the build container if necessary.