Simplify the builders configuration

1. Add driver as an option, defaulting to `docker-container`. For a
   "native" build you can set it to `docker`
2. Set arch as a array of architectures to build for, defaulting to
   `[ "amd64", "arm64" ]` unless you are using the docker driver in
   which case we default to not setting a platform
3. Remote is now just a connection string for the remote builder
4. If remote is set, we only use it for non-local arches, if we are
   only building for the local arch, we'll ignore it.

Examples:

On arm64, build for arm64 locally, amd64 remotely or
On amd64, build for amd64 locally, arm64 remotely:

```yaml
builder:
  remote: ssh://docker@docker-builder
```

On arm64, build amd64 on remote,
On amd64 build locally:

```yaml
builder:
  arch:
    - amd64
  remote:
    host: ssh://docker@docker-builder
```

Build amd64 on local:

```yaml
builder:
  arch:
    - amd64
```

Use docker driver, building for local arch:

```yaml
builder:
  driver: docker
```
This commit is contained in:
Donal McBreen
2024-08-01 14:06:41 +01:00
committed by Donal McBreen
parent cffb6c3d7e
commit 56268d724d
19 changed files with 140 additions and 206 deletions

View File

@@ -36,6 +36,5 @@ accessories:
readiness_delay: 0
builder:
remote:
arch: amd64
host: ssh://app@1.1.1.5
arch: <%= `uname -m`.strip == "x86_64" ? "arm64" : "amd64" %>
remote: ssh://app@1.1.1.5

View File

@@ -40,6 +40,5 @@ ssh:
port: 22
builder:
remote:
arch: amd64
host: ssh://app@1.1.1.5:2122
arch: <%= `uname -m`.strip == "x86_64" ? "arm64" : "amd64" %>
remote: ssh://app@1.1.1.5:2122