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: ...@@ -29,7 +29,10 @@ build:
before_script: before_script:
- pacman -Syu --needed --noconfirm qemu-headless libisoburn - pacman -Syu --needed --noconfirm qemu-headless libisoburn
script: script:
- echo "BUILD_DATE=$(date -I)" > build.env
- . build.env
- ./build-in-qemu.sh - ./build-in-qemu.sh
- mv build.env output/
artifacts: artifacts:
name: "output" name: "output"
paths: paths:
...@@ -44,13 +47,12 @@ publish: ...@@ -44,13 +47,12 @@ publish:
before_script: before_script:
- pacman -Syu --needed --noconfirm vagrant - pacman -Syu --needed --noconfirm vagrant
script: 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 auth login --check
- vagrant cloud box show archlinux/archlinux - 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}'` - vagrant cloud publish archlinux/archlinux "v${BUILD_DATE}" libvirt output/Arch-Linux-x86_64-libvirt-*.box --release -f
- 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 "v${BUILD_DATE}" virtualbox output/Arch-Linux-x86_64-virtualbox-*.box --release -f
- 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: only:
variables: variables:
- $SCHEDULED_PUBLISH == "TRUE" - $SCHEDULED_PUBLISH == "TRUE"
......
...@@ -219,7 +219,9 @@ postinstall ...@@ -219,7 +219,9 @@ postinstall
arch-chroot "${MOUNT}" grub-install --target=i386-pc "${LOOPDEV}" arch-chroot "${MOUNT}" grub-install --target=i386-pc "${LOOPDEV}"
unmount_image unmount_image
DATE="$(date -I)" if [ -z "${BUILD_DATE:-}" ]; then
create_image "cloud-img.img" "Arch-Linux-x86_64-cloudimg-${DATE}.qcow2" cloud_image cloud_image_post BUILD_DATE="$(date -I)"
create_image "vagrant-qemu.img" "Arch-Linux-x86_64-libvirt-${DATE}.box" vagrant_qemu vagrant_qemu_post fi
create_image "vagrant-virtualbox.img" "Arch-Linux-x86_64-virtualbox-${DATE}.box" vagrant_qemu vagrant_virtualbox_post 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
Supports Markdown
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