default: image: "archlinux:latest" stages: - lint - build - test - publish - cleanup shellcheck: stage: lint before_script: - pacman -Syu --needed --noconfirm shellcheck script: - shopt -s globstar - shellcheck **/*.sh shfmt: stage: lint before_script: - pacman -Syu --needed --noconfirm shfmt script: - shopt -s globstar - shfmt -i 2 -ci -d **/*.sh .build: stage: build before_script: - pacman -Syu --needed --noconfirm gptfdisk btrfs-progs dosfstools arch-install-scripts qemu-img jq script: - echo "BUILD_VERSION=$(date +%Y%m%d).$CI_JOB_ID" > build.env - export $(< build.env) - ./build.sh "${BUILD_VERSION}" after_script: - echo "image_size_megabytes{image=\"basic\"} $(du -m output/*basic*qcow2)" > metrics.txt - echo "image_size_megabytes{image=\"cloudimg\"} $(du -m output/*cloudimg*qcow2)" >> metrics.txt - echo "image_size_megabytes{image=\"libvirt\"} $(du -m output/*libvirt*box)" >> metrics.txt - echo "image_size_megabytes{image=\"virtualbox\"} $(du -m output/*virtualbox*box)" >> metrics.txt artifacts: name: "output" paths: - "output/*" expire_in: 2d reports: metrics: metrics.txt dotenv: build.env build: extends: .build tags: - vm except: - master@archlinux/arch-boxes - schedules@archlinux/arch-boxes build:secure: extends: .build tags: - secure - vm only: - master@archlinux/arch-boxes - schedules@archlinux/arch-boxes script: - !reference [.build, script] - gpg --import < <(echo "${GPG_PRIVATE_KEY}") - | for file in output/*; do gpg --detach-sign "${file}" done test-vagrant-boxes-format: stage: test before_script: - pacman -Syu --needed --noconfirm vagrant script: - vagrant box add output/Arch-Linux-x86_64-virtualbox-*.box --name archlinux-vbox - vagrant box add output/Arch-Linux-x86_64-libvirt-*.box --name archlinux-libvirt test-basic-qemu-bios: stage: test tags: - fast-single-thread variables: SSHPASS: arch before_script: - pacman -Syu --needed --noconfirm qemu-base sshpass script: - qemu-system-x86_64 -m 512 -net nic -net user,hostfwd=tcp::2222-:22 -drive file=$(ls output/Arch-Linux-x86_64-basic-*.qcow2),if=virtio -nographic & - timeout 15m sh -c "while ! sshpass -e ssh -o ConnectTimeout=2 -o StrictHostKeyChecking=no arch@localhost -p 2222 sudo true; do sleep 1; done" test-cloudimg-qemu-bios: stage: test tags: - fast-single-thread variables: SSHPASS: passw0rd before_script: - pacman -Syu --needed --noconfirm qemu-base cdrtools sshpass script: - | cat > user-data < meta-data < user-data < meta-data <