From 82568d7ac0531798221c7294cba38dc94cebd082 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Thu, 15 Nov 2018 23:37:40 +0100 Subject: [PATCH] Add .gitlab-ci.yml --- .gitlab-ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..e2dccc8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +test: + image: centos:latest + + retry: 1 + + before_script: + - yum update -y + - yum install -y net-tools libguestfs-tools-c qemu openssh openssh-clients sshpass + + script: + - ssh-keygen -q -N '' -f ~/.ssh/id_rsa + - printf '%s\n\t' 'Host *' 'ServerAliveInterval 15' 'UserKnownHostsFile /dev/null' 'StrictHostKeyChecking no' 'CheckHostIP no' > ~/.ssh/config + - 'LIBGUESTFS_BACKEND=direct virt-builder --arch x86_64 debian-9 -o debian.raw --root-password password:root --ssh-inject root --install wget,ca-certificates --firstboot-command "dpkg-reconfigure openssh-server"' + - /usr/libexec/qemu-kvm -m 256 -daemonize -drive file=debian.raw,if=virtio -net nic -net user,hostfwd=tcp::10022-:22 -display none -vga none + - sleep 60 + - 'ssh -p 10022 root@127.0.0.1 "wget http://tinyurl.com/vps2arch && chmod +x vps2arch && ./vps2arch -n netctl -b syslinux && sync ; reboot -f" || true' + - sleep 600 + - sshpass -proot ssh -p 10022 root@127.0.0.1 test -f /etc/arch-release