diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index f6d9299..9576e14 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -42,6 +42,9 @@ jobs: ref: refs/tags/${{ github.event.inputs.version }} if: github.event.inputs.version + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Set version from tag/branch run: | echo "RELEASE_VERSION=$GITHUB_REF_NAME" >>"$GITHUB_ENV" diff --git a/Makefile b/Makefile index fe6f8b7..8d80876 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ build-golang-executable: build-online-zip: $(CLIENT) build \ + --platform linux/amd64 \ -t mirror-registry-online:${RELEASE_VERSION} \ --build-arg RELEASE_VERSION=${RELEASE_VERSION} \ --build-arg QUAY_IMAGE=${QUAY_IMAGE} \ @@ -29,6 +30,7 @@ build-online-zip: build-offline-zip: $(CLIENT) build \ + --platform linux/amd64 \ -t mirror-registry-offline:${RELEASE_VERSION} \ --build-arg RELEASE_VERSION=${RELEASE_VERSION} \ --build-arg QUAY_IMAGE=${QUAY_IMAGE} \ diff --git a/test/Makefile b/test/Makefile index e8fd507..5140a50 100644 --- a/test/Makefile +++ b/test/Makefile @@ -12,6 +12,15 @@ VERSION := dev-$(TREEISH) # from. OLD_VERSION := 1.2.9 +# VAGRANT_UP_ARGS allows to provide additional arguments to `vagrant up`. +# Example: +# make test-install VAGRANT_UP_ARGS='--provider=qemu' +ifeq ($(shell uname -s) $(shell uname -m),Darwin arm64) +VAGRANT_UP_ARGS := --provider=qemu +else +VAGRANT_UP_ARGS := +endif + all: test-install test-sudo-install test-sudo-upgrade # mirror-registry archive from the current repository. @@ -36,7 +45,7 @@ $(MAKE) start-vagrant && (set -x; $(1)); ret=$$?; $(MAKE) stop-vagrant && exit $ endef start-vagrant: - vagrant up + vagrant up $(VAGRANT_UP_ARGS) stop-vagrant: ifneq ($(DEBUG), 1) diff --git a/test/Vagrantfile b/test/Vagrantfile index 14e2715..e6e2a75 100644 --- a/test/Vagrantfile +++ b/test/Vagrantfile @@ -2,13 +2,33 @@ # vi: set ft=ruby : Vagrant.configure("2") do |config| - config.vm.box = "generic/fedora37" + config.vm.box = "generic/fedora36" + config.vm.box_architecture = "amd64" config.vm.network "forwarded_port", guest: 8080, host: 8080 config.vm.network "forwarded_port", guest: 8443, host: 8443 config.vm.provider "virtualbox" do |vb| vb.memory = "3072" end + config.vm.provider "qemu" do |qe| + qe.arch = "x86_64" + qe.machine = "q35" + qe.cpu = "max" + qe.smp = "cpus=4,sockets=1,cores=4,threads=1" + qe.memory = "3072" + qe.net_device = "virtio-net-pci" + qe.extra_qemu_args = %w(-accel tcg,thread=multi,tb-size=512) + qe.forward_port("guestssh", 22, 50021, auto: true) + end config.vm.provision "shell", inline: <<-SHELL + set -x + + # On macOS with qemu, the systemd-resolved does not work properly. To work + # around this issue, we disable the systemd-resolved and use Google's DNS. + systemctl stop systemd-resolved + systemctl disable systemd-resolved + rm -f /etc/resolv.conf + echo "nameserver 8.8.8.8" >/etc/resolv.conf + dnf install -y \ acl \ openssl \