Parcourir la source

Merge pull request #741 from jcfr/fix-circleci-test-driver

COMP: Update run_opengl.sh to gracefully ignore "Driver btrfs" error on CircleCI
Jean-Christophe Fillion-Robin il y a 7 ans
Parent
commit
6ab52a514b

+ 1 - 1
CMake/CircleCI/Dockerfile-qt4

@@ -1,4 +1,4 @@
-FROM thewtex/opengl:v0.1.0
+FROM thewtex/opengl:debian
 MAINTAINER Insight Software Consortium <community@itk.org>
 
 RUN REPO=http://cdn-fastly.deb.debian.org && \

+ 4 - 1
CMake/CircleCI/Dockerfile-qt5

@@ -1,4 +1,4 @@
-FROM thewtex/opengl:v0.1.0
+FROM thewtex/opengl:debian
 MAINTAINER Insight Software Consortium <community@itk.org>
 
 RUN REPO=http://cdn-fastly.deb.debian.org && \
@@ -10,6 +10,9 @@ RUN apt-get update && apt-get install -y \
   wget && \
   rm -rf /var/lib/apt/lists/*
 
+# Allow code written for more recent Qt version to compile
+RUN cp -r  /usr/include/x86_64-linux-gnu/qt5/QtDesigner/ /usr/include/x86_64-linux-gnu/qt5/QtUiPlugin
+
 RUN wget https://cmake.org/files/v3.7/cmake-3.7.1-Linux-x86_64.tar.gz && \
   tar -xzf cmake-3.7.1-Linux-x86_64.tar.gz && \
   rsync -avz cmake-3.7.1-Linux-x86_64/ /usr/local

+ 8 - 1
CMake/CircleCI/build.sh

@@ -1,6 +1,13 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
+set -o pipefail
 
 script_dir="`cd $(dirname $0); pwd`"
 
+pushd $script_dir
+
 docker build -t commontk/ctk-test:opengl-qt4 $script_dir -f Dockerfile-qt4
 docker build -t commontk/ctk-test:opengl-qt5 $script_dir -f Dockerfile-qt5
+
+popd

+ 4 - 1
CMake/CircleCI/run.sh

@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
+set -o pipefail
 
 script_dir="`cd $(dirname $0); pwd`"
 

+ 12 - 1
CMake/CircleCI/run_opengl.sh

@@ -92,7 +92,18 @@ url="http://${ip}:$port"
 
 cleanup() {
 	docker stop $container >/dev/null
-	docker rm $container >/dev/null
+
+    # Attempt to delete container
+    rm_output=$(docker rm -f $container 2>&1)
+    rm_exit_code=$?
+    if [[ $rm_exit_code != 0 ]]; then
+      if [[ "$CIRCLECI" == "true" ]] && [[ $rm_output == *"Driver btrfs failed to remove"* ]]; then
+        : # Ignore error because of https://circleci.com/docs/docker-btrfs-error/
+      else
+        echo "$rm_output"
+        return $rm_exit_code
+      fi
+    fi
 }
 
 running=$(docker ps -a -q --filter "name=${container}")

+ 3 - 0
CMake/CircleCI/test.sh

@@ -1,5 +1,8 @@
 #!/bin/bash
 
+set -e
+set -o pipefail
+
 # This is a script to build the modules and run the test suite in the base
 # Docker container.