Skip to content

Commit

Permalink
vm-builder,ci: pass target arch as vm-builder argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail-sakhnov committed Oct 21, 2024
1 parent 089f067 commit 956d57f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-test-vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ env:
IMG_POSTGRES_16_BULLSEYE: "neondatabase/vm-postgres-16-bullseye"
# using image built in the same workflow
IMG_DAEMON: "daemon:dev"
TARGET_ARCH: "amd64"

defaults:
run:
Expand Down Expand Up @@ -85,7 +86,7 @@ jobs:

- name: build ${{ needs.tags.outputs.vm-postgres-16-bullseye }}
run: |
./bin/vm-builder -src postgres:16-bullseye -spec tests/e2e/image-spec.yaml -dst ${{ needs.tags.outputs.vm-postgres-16-bullseye }} -daemon-image ${{ needs.tags.outputs.daemon }}
./bin/vm-builder -src postgres:16-bullseye -spec tests/e2e/image-spec.yaml -dst ${{ needs.tags.outputs.vm-postgres-16-bullseye }} -daemon-image ${{ needs.tags.outputs.daemon }} -target-arch linux/${TARGET_ARCH}
- name: docker push ${{ needs.tags.outputs.vm-postgres-16-bullseye }}
run: |
docker push ${{ needs.tags.outputs.vm-postgres-16-bullseye }}
13 changes: 8 additions & 5 deletions .github/workflows/vm-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- cron: '42 4 * * 2' # run once a week
workflow_dispatch: # adds ability to run this manually

env:
TARGET_ARCH: amd64

jobs:
vm-example:
runs-on: ubuntu-latest
Expand All @@ -31,26 +34,26 @@ jobs:
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}

- name: build vm-alpine:3.16
run: bin/vm-builder -src alpine:3.16 -dst neondatabase/vm-alpine:3.16
run: bin/vm-builder -src alpine:3.16 -dst neondatabase/vm-alpine:3.16 -target-arch/${TARGET_ARCH}
- name: push vm-alpine:3.16
run: docker push -q neondatabase/vm-alpine:3.16

- name: build vm-ubuntu:22.04
run: bin/vm-builder -src ubuntu:22.04 -dst neondatabase/vm-ubuntu:22.04
run: bin/vm-builder -src ubuntu:22.04 -dst neondatabase/vm-ubuntu:22.04 -target-arch/${TARGET_ARCH}
- name: push vm-ubuntu:22.04
run: docker push -q neondatabase/vm-ubuntu:22.04

- name: build vm-debian:11
run: bin/vm-builder -src debian:11 -dst neondatabase/vm-debian:11
run: bin/vm-builder -src debian:11 -dst neondatabase/vm-debian:11 -target-arch/${TARGET_ARCH}
- name: push vm-debian:11
run: docker push -q neondatabase/vm-debian:11

- name: build vm-postgres:14-alpine
run: bin/vm-builder -src postgres:14-alpine -dst neondatabase/vm-postgres:14-alpine
run: bin/vm-builder -src postgres:14-alpine -dst neondatabase/vm-postgres:14-alpine -target-arch/${TARGET_ARCH}
- name: push vm-postgres:14-alpine
run: docker push -q neondatabase/vm-postgres:14-alpine

- name: build vm-postgres:15-alpine
run: bin/vm-builder -src postgres:15-alpine -dst neondatabase/vm-postgres:15-alpine
run: bin/vm-builder -src postgres:15-alpine -dst neondatabase/vm-postgres:15-alpine -target-arch/${TARGET_ARCH}
- name: push vm-postgres:15-alpine
run: docker push -q neondatabase/vm-postgres:15-alpine

0 comments on commit 956d57f

Please sign in to comment.