default: image: "archlinux:latest" stages: - lint - build - publish shellcheck: stage: lint before_script: - pacman -Syu --needed --noconfirm shellcheck script: - find . -iname "*.sh" -exec shellcheck {} + shfmt: stage: lint before_script: - pacman -Syu --needed --noconfirm shfmt script: - find . -iname "*.sh" -exec shfmt -i 2 -ci -d {} + # Note: We explicitly need the `ipv6` tag here because otherwise we'd get random # gpg/pacman-key issues. build: stage: build tags: - ipv6 before_script: - pacman -Syu --needed --noconfirm qemu-headless libisoburn script: - ./build-in-qemu.sh artifacts: name: "output" paths: - "output/*" expire_in: 2d publish: stage: publish tags: - ipv6 - secure before_script: - pacman -Syu --needed --noconfirm vagrant script: - vagrant cloud auth login --token $VAGRANT_API_TOKEN - vagrant cloud auth login --check - vagrant cloud box show archlinux/archlinux - LIBVIRT_RELEASE=`ls output/Arch-Linux-x86_64-libvirt-*.box | awk -F "." '{print $1}' | awk -F "-" '{print $5"."$6"."$7}'` - VIRTUALBOX_RELEASE=`ls output/Arch-Linux-x86_64-virtualbox-*.box | awk -F "." '{print $1}' | awk -F "-" '{print $5"."$6"."$7}'` - vagrant cloud publish archlinux/archlinux $LIBVIRT_RELEASE libvirt output/Arch-Linux-x86_64-libvirt-*.box --release -f - vagrant cloud publish archlinux/archlinux $VIRTUALBOX_RELEASE virtualbox output/Arch-Linux-x86_64-virtualbox-*.box --release -f only: variables: - $SCHEDULED_PUBLISH == "TRUE" resource_group: vm-build