浏览代码

COMP: Update run_opengl.sh to gracefully ignore "Driver btrfs" error on CircleCI

Jean-Christophe Fillion-Robin 7 年之前
父节点
当前提交
e968ecf976
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12 1
      CMake/CircleCI/run_opengl.sh

+ 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}")