Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
arch-boxes
Commits
6ab4fa0e
Commit
6ab4fa0e
authored
Aug 30, 2020
by
Kristian Klausen
🎉
Browse files
Store build date as env variable
parent
775ef809
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
6ab4fa0e
...
@@ -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"
...
...
build.sh
View file @
6ab4fa0e
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment