build: multi arch docker images
Some checks are pending
test / test (push) Waiting to run

This commit is contained in:
Marvin Preuss 2024-09-24 10:33:40 +02:00
parent 0ef3d0e890
commit 95cf80c71d
2 changed files with 38 additions and 8 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
.direnv .direnv
result result
result-*
dist/ dist/

View File

@ -8,6 +8,7 @@ tasks:
cmds: cmds:
- task: clean - task: clean
- task: lint - task: lint
- task: docker-build-all
- task: test-all - task: test-all
ci-publish: ci-publish:
@ -15,27 +16,53 @@ tasks:
- task: clean - task: clean
- task: lint - task: lint
- task: test-all - task: test-all
- task: docker-publish - task: docker-publish-all
clean: clean:
cmds: cmds:
- rm -rf result - rm -rf result-*
docker-build: docker-build:
requires:
vars:
- ARCH
status: status:
- test -f result - test -f result-{{.ARCH}}
cmds: cmds:
- nix build .#docker - nix build .#docker --option system {{.ARCH}}
- mv result result-{{.ARCH}}
docker-build-all:
cmds:
- for:
- x86_64-linux
- aarch64-linux
task: docker-build
vars:
ARCH: "{{.ITEM}}"
docker-publish-all:
cmds:
- for:
- x86_64-linux
- aarch64-linux
task: docker-publish
vars:
ARCH: "{{.ITEM}}"
docker-local-import: docker-local-import:
vars:
ARCH: '{{default "x86_64-linux" .ARCH}}'
cmds: cmds:
- task: docker-build - task: docker-build
vars:
ARCH: "{{.ARCH}}"
- | - |
{{.NIX_CMD_BASE}} \ {{.NIX_CMD_BASE}} \
skopeo \ skopeo \
--insecure-policy \ --insecure-policy \
copy \ copy \
docker-archive:$(readlink -f result) \ docker-archive:$(readlink -f result-{{.ARCH}}) \
docker-daemon:caddy-log-exporter:NOTUSE docker-daemon:caddy-log-exporter:NOTUSE
- | - |
{{.NIX_CMD_BASE}} \ {{.NIX_CMD_BASE}} \
@ -46,19 +73,22 @@ tasks:
docker-publish: docker-publish:
requires: requires:
vars: vars:
- ARCH
- GITHUB_USERNAME - GITHUB_USERNAME
- GITHUB_PASSWORD - GITHUB_PASSWORD
- GIT_TAG - GIT_TAG
cmds: cmds:
- task: docker-build - task: docker-build
vars:
ARCH: "{{.ARCH}}"
- | - |
{{.NIX_CMD_BASE}} \ {{.NIX_CMD_BASE}} \
skopeo \ skopeo \
--insecure-policy \ --insecure-policy \
copy \ copy \
--dest-username {{.GITHUB_USERNAME}} --dest-password {{.GITHUB_PASSWORD}} \ --dest-username {{.GITHUB_USERNAME}} --dest-password {{.GITHUB_PASSWORD}} \
docker-archive:$(readlink -f result) \ docker-archive:$(readlink -f result-{{.ARCH}}) \
docker://ghcr.io/xsteadfastx/caddy-log-exporter:{{.GIT_TAG}} docker://ghcr.io/xsteadfastx/caddy-log-exporter-{{.ARCH}}:{{.GIT_TAG}}
docker-inspect: docker-inspect:
cmds: cmds: