Commit 6ab4fa0e authored by Kristian Klausen's avatar Kristian Klausen 🎉
Browse files

Store build date as env variable

parent 775ef809
......@@ -29,7 +29,10 @@ build:
before_script:
- pacman -Syu --needed --noconfirm qemu-headless libisoburn
script:
- echo "BUILD_DATE=$(date -I)" > build.env
- . build.env
- ./build-in-qemu.sh
- mv build.env output/
artifacts:
name: "output"
paths:
......@@ -44,13 +47,12 @@ publish:
before_script:
- pacman -Syu --needed --noconfirm vagrant
script:
- vagrant cloud auth login --token $VAGRANT_API_TOKEN
- . output/build.env
- 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
- vagrant cloud publish archlinux/archlinux "v${BUILD_DATE}" libvirt output/Arch-Linux-x86_64-libvirt-*.box --release -f
- vagrant cloud publish archlinux/archlinux "v${BUILD_DATE}" virtualbox output/Arch-Linux-x86_64-virtualbox-*.box --release -f
only:
variables:
- $SCHEDULED_PUBLISH == "TRUE"
......
......@@ -219,7 +219,9 @@ postinstall
arch-chroot "${MOUNT}" grub-install --target=i386-pc "${LOOPDEV}"
unmount_image
DATE="$(date -I)"
create_image "cloud-img.img" "Arch-Linux-x86_64-cloudimg-${DATE}.qcow2" cloud_image cloud_image_post
create_image "vagrant-qemu.img" "Arch-Linux-x86_64-libvirt-${DATE}.box" vagrant_qemu vagrant_qemu_post
create_image "vagrant-virtualbox.img" "Arch-Linux-x86_64-virtualbox-${DATE}.box" vagrant_qemu vagrant_virtualbox_post
if [ -z "${BUILD_DATE:-}" ]; then
BUILD_DATE="$(date -I)"
fi
create_image "cloud-img.img" "Arch-Linux-x86_64-cloudimg-${BUILD_DATE}.qcow2" cloud_image cloud_image_post
create_image "vagrant-qemu.img" "Arch-Linux-x86_64-libvirt-${BUILD_DATE}.box" vagrant_qemu vagrant_qemu_post
create_image "vagrant-virtualbox.img" "Arch-Linux-x86_64-virtualbox-${BUILD_DATE}.box" vagrant_qemu vagrant_virtualbox_post
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment