Skip to content

Commit

Permalink
Merge pull request #18 from gardenlinux/fix/pr5
Browse files Browse the repository at this point in the history
Fix #5
  • Loading branch information
nkraetzschmar committed Jun 28, 2023
2 parents df18666 + 66d504f commit 147fe95
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ If you're new to configuring the Builder, you can find a minimal example config
Feel free to explore these examples to gain a better understanding of how to effectively structure your own config directory.


## Contribute
## Local Development

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:
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.

sudo podman build -t localhost/builder .

# or

docker build -t localhost/builder .
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.
5 changes: 5 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,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)"
Expand Down

0 comments on commit 147fe95

Please sign in to comment.