From 34fc51389f866920cbeb1e9cc821e993b559319c Mon Sep 17 00:00:00 2001 From: Alexey Rogachevskiy Date: Mon, 20 Jul 2020 21:52:52 +0300 Subject: [PATCH] travis: Enable image builds for main branch Squashed commit of the following: commit c70fc8dd0b1e426e4ff1051ecfa1ac0ac924de03 Author: Alexey Rogachevskiy Date: Thu Jul 9 21:26:47 2020 +0300 travis: Use proper bucket name commit d9fc21773b57f353f854c1e3861bfb52afd79521 Author: Alexey Rogachevskiy Date: Thu Jul 9 21:14:38 2020 +0300 travis: Use S3 key stored in travis environment commit 8ef93c928aa43aaea137aae5518e575fc7242a5c Author: Alexey Rogachevskiy Date: Thu Jul 9 20:02:28 2020 +0300 travis: Set actual S3 endpoint commit 848e4b33f738f2836a627613c5710e837fe05209 Author: Alexey Rogachevskiy Date: Thu Jul 9 18:50:41 2020 +0300 travis: Try enabling deployments commit 11196f0c7d1b29015b94c533919415eebed2b645 Author: Alexey Rogachevskiy Date: Thu Jul 9 17:03:44 2020 +0300 scripts: Allow apt to finish doing initial updates commit 46064eafe2b77adc1644d94851ee33d82fdabfb4 Author: Alexey Rogachevskiy Date: Sun Jul 5 22:16:18 2020 +0300 ros_ide_vm: Be even more CI-friendly commit 72f35a0b048950a940302f2a7df9807847590adf Author: Alexey Rogachevskiy Date: Sun Jul 5 22:05:57 2020 +0300 ros_ide_vm: Allocate less resources for build commit 246ba6e5fb3a54c57727ef7b925774264e840e17 Author: Alexey Rogachevskiy Date: Sun Jul 5 22:04:16 2020 +0300 travis: Download base VM instead of building it commit 9d2830bfebf31385b3be568c0202b3fa725f2d8b Author: Alexey Rogachevskiy Date: Sun Jul 5 20:29:26 2020 +0300 base_vm: Try building in headless mode commit 31db3964775cf37dede5ea9fdf1163ed923cc1ed Author: Alexey Rogachevskiy Date: Sun Jul 5 18:22:54 2020 +0300 base_vm: Use simplier hardware config commit 8709ec587329d758ad609553f1137208172c4ab7 Author: Alexey Rogachevskiy Date: Sun Jul 5 18:05:59 2020 +0300 build: Download Packer in CI environment (hack) commit 691cdde431bbd8464a5c5a67ca4830fade38776b Author: Alexey Rogachevskiy Date: Sun Jul 5 17:58:23 2020 +0300 travis: Bump Virtualbox version commit e2c6d709dbd841764bc3255db3624eb0033ea317 Author: Alexey Rogachevskiy Date: Sun Jul 5 17:54:11 2020 +0300 travis: Try running Packer in CI --- .travis.yml | 24 ++++++++++++++++++++++++ base_vm.json | 4 +++- build.sh | 10 ++++++---- ros_ide_vm.json | 4 +++- scripts/installSoftware.sh | 3 +++ 5 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7fed24d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +language: generic +dist: bionic +before_install: +- wget https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key + add - && sudo sh -c "echo deb https://download.virtualbox.org/virtualbox/debian + bionic contrib >> /etc/apt/sources.list" && sudo apt-get update && sudo apt-get + install build-essential gcc make linux-headers-$(uname -r) virtualbox-6.1 && sudo + usermod -aG vboxusers $(whoami) +- mkdir output-virtualbox-iso && pushd output-virtualbox-iso && wget https://github.com/sfalexrog/clever_vm/releases/download/v0_base_vm/clever-devel.ova + && popd +script: +- "./build.sh" +deploy: + provider: s3 + access_key_id: XOJXX4IOM66XN7VZAFYX + secret_access_key: $S3_SECRET_KEY + bucket: clovervm + local-dir: output-virtualbox-ovf + upload-dir: ci-builds + acl: public_read + on: + all_branches: true + skip_cleanup: true + endpoint: https://ams3.digitaloceanspaces.com diff --git a/base_vm.json b/base_vm.json index c660e05..2d033f1 100644 --- a/base_vm.json +++ b/base_vm.json @@ -13,10 +13,12 @@ "disk_size": "30000", "hard_drive_interface": "sata", "vboxmanage": [ - ["modifyvm", "{{.Name}}", "--memory", "4096", "--vram", "128", "--mouse", "usbtablet", "--accelerate3d", "on", "--apic", "on", "--rtcuseutc", "on", "--graphicscontroller", "vmsvga", "--nictype1", "virtio"], + ["modifyvm", "{{.Name}}", "--memory", "2048", "--mouse", "usbtablet", "--apic", "on", "--rtcuseutc", "on", "--nictype1", "virtio"], ["storageattach", "{{.Name}}", "--storagectl", "SATA Controller", "--port", "0", "--nonrotational", "on", "--discard", "on"] ], + "headless": "true", + "iso_url": "http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/mini.iso", "iso_checksum": "bed8a55ae2a657f8349fe3271097cff3a5b8c3d1048cf258568f1601976fa30d", "iso_checksum_type": "sha256", diff --git a/build.sh b/build.sh index 2ee16fc..e9d5bc9 100755 --- a/build.sh +++ b/build.sh @@ -1,20 +1,22 @@ #!/bin/bash -PACKER=$(which packer) +# FIXME: Use system Packer if possible +#PACKER=$(which packer) -if [ "x${PACKER}" == "x" ]; then +#if [ "x${PACKER}" == "x" ]; then +PACKER="./packer" +if [ ! -f ${PACKER} ]; then echo "Packer not found; downloading v1.5.4 from Hashicorp" wget https://releases.hashicorp.com/packer/1.5.4/packer_1.5.4_linux_amd64.zip unzip packer_1.5.4_linux_amd64.zip rm packer_1.5.4_linux_amd64.zip - PACKER="./packer" fi echo "--- Using Packer version $(${PACKER} --version)" echo "--- Building base image" -${PACKER} build base_vm.json +${PACKER} build -only=virtualbox-iso base_vm.json echo "--- Building extended image" diff --git a/ros_ide_vm.json b/ros_ide_vm.json index b30e439..dd06eea 100644 --- a/ros_ide_vm.json +++ b/ros_ide_vm.json @@ -13,8 +13,10 @@ "format": "ova", "guest_additions_mode": "disable", + "headless": "true", + "vboxmanage": [ - ["modifyvm", "{{.Name}}", "--memory", "8192", "--vram", "128", "--mouse", "usbtablet", "--rtcuseutc", "on", "--usb", "on", "--usbxhci", "on", "--nictype1", "virtio"], + ["modifyvm", "{{.Name}}", "--memory", "6144", "--vram", "128", "--mouse", "usbtablet", "--rtcuseutc", "on", "--nictype1", "virtio"], ["storageattach", "{{.Name}}", "--storagectl", "SATA Controller", "--port", "0", "--nonrotational", "on", "--discard", "on"] ], "import_opts": "importtovdi", diff --git a/scripts/installSoftware.sh b/scripts/installSoftware.sh index dc05e02..2b7c96e 100644 --- a/scripts/installSoftware.sh +++ b/scripts/installSoftware.sh @@ -12,6 +12,9 @@ echo "--- Increasing apt retries" sudo -E sh -c 'echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries' cat /etc/apt/apt.conf.d/80-retries +echo "--- Allowing apt to perform its updates" +sudo -E sh -c 'apt update; while fuser /var/lib/dpkg/lock ; do sleep 0.5 ; done' + echo "--- Installing open-vm-tools" sudo -E sh -c 'apt update; apt install -y open-vm-tools open-vm-tools-desktop'