[CRIU] [PATCH 3/3] travis: use docker to build criu (v2)
Andrey Vagin
avagin at gmail.com
Fri Feb 19 16:18:50 PST 2016
From: Andrey Vagin <avagin at openvz.org>
v2: create a separate job for each arch
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
.travis.yml | 18 ++++++-------
scripts/travis-ci.sh | 71 ----------------------------------------------------
2 files changed, 8 insertions(+), 81 deletions(-)
delete mode 100755 scripts/travis-ci.sh
diff --git a/.travis.yml b/.travis.yml
index 191832c..b33b79d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,13 +1,11 @@
language: c
-env:
- - ARCH=arm
- - ARCH=x86
-compiler:
- - gcc
-before_install:
- - sudo apt-get update -qq
- - sudo apt-get install -qq protobuf-c-compiler libprotobuf-c0-dev libaio-dev libprotobuf-dev protobuf-compiler python-ipaddr libcap-dev libnl-3-dev
-script:
- - "bash -ex scripts/travis-ci.sh"
sudo: required
dist: trusty
+services:
+ - docker
+env:
+ - TR_ARCH=x86_64
+ - TR_ARCH=armv7hf
+ - TR_ARCH=aarch64
+before_install:
+ - sudo make -C scripts/build $TR_ARCH
diff --git a/scripts/travis-ci.sh b/scripts/travis-ci.sh
deleted file mode 100755
index 5edfd41..0000000
--- a/scripts/travis-ci.sh
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/bash
-# Based on a test script from avsm/ocaml repo https://github.com/avsm/ocaml
-
-CHROOT_DIR=/tmp/arm-chroot
-MIRROR=http://ports.ubuntu.com/ubuntu-ports/
-VERSION=trusty
-CHROOT_ARCH=armhf
-
-# Debian package dependencies for the host
-HOST_DEPENDENCIES="debootstrap qemu-user-static binfmt-support sbuild"
-
-# Debian package dependencies for the chrooted environment
-GUEST_DEPENDENCIES="build-essential git m4 sudo python protobuf-c-compiler libprotobuf-c0-dev gcc make bsdmainutils bash libaio-dev libprotobuf-dev protobuf-compiler python-ipaddr libcap-dev libnl-3-dev"
-
-# Command used to run the tests
-TEST_COMMAND="make -j 4 && make -j 4 -C test/zdtm"
-
-function setup_arm_chroot {
- # Host dependencies
- sudo apt-get install -qq -y ${HOST_DEPENDENCIES}
-
- # Create chrooted environment
- sudo mkdir ${CHROOT_DIR}
- sudo debootstrap --foreign --no-check-gpg --include=fakeroot,build-essential \
- --arch=${CHROOT_ARCH} ${VERSION} ${CHROOT_DIR} ${MIRROR}
- sudo cp /usr/bin/qemu-arm-static ${CHROOT_DIR}/usr/bin/
- sudo chroot ${CHROOT_DIR} ./debootstrap/debootstrap --second-stage
- sudo sbuild-createchroot --arch=${CHROOT_ARCH} --foreign --setup-only --components=main,universe,multiverse \
- ${VERSION} ${CHROOT_DIR} ${MIRROR}
-
- # Create file with environment variables which will be used inside chrooted
- # environment
- echo "export ARCH=${ARCH}" > envvars.sh
- echo "export TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR}" >> envvars.sh
- chmod a+x envvars.sh
-
- # Install dependencies inside chroot
- sudo chroot ${CHROOT_DIR} apt-get update
- sudo chroot ${CHROOT_DIR} apt-get --allow-unauthenticated install \
- -qq -y ${GUEST_DEPENDENCIES}
-
- # Create build dir and copy travis build files to our chroot environment
- sudo mkdir -p ${CHROOT_DIR}/${TRAVIS_BUILD_DIR}
- sudo rsync -av ${TRAVIS_BUILD_DIR}/ ${CHROOT_DIR}/${TRAVIS_BUILD_DIR}/
-
- # Indicate chroot environment has been set up
- sudo touch ${CHROOT_DIR}/.chroot_is_done
-
- # Call ourselves again which will cause tests to run
- sudo chroot ${CHROOT_DIR} bash -c "cd ${TRAVIS_BUILD_DIR} && ./scripts/travis-ci.sh"
-}
-
-if [ -e "/.chroot_is_done" ]; then
- # We are inside ARM chroot
- echo "Running inside chrooted environment"
-
- . ./envvars.sh
-else
- if [ "${ARCH}" = "arm" ]; then
- # ARM test run, need to set up chrooted environment first
- echo "Setting up chrooted ARM environment"
- setup_arm_chroot
- exit
- fi
-fi
-
-export LIBRARY_PATH=/usr/lib/${ARCH}-linux-gnu/
-echo "Running tests"
-echo "Environment: $(uname -a)"
-
-eval ${TEST_COMMAND}
--
2.5.0
More information about the CRIU
mailing list