[PATCH v2 3/6] travis: Introduce MACOS_CMD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It mirrors the existing DOCKER_CMD, both in how it's defined
as part of the environment and how it's called by passing it
directly to the shell.

In addition to making the configuration more consistent, this
also allows us to move from having the macOS build script
divided into four steps, some of which have slightly different
semantics and the relationship between which is not immediately
obvious without consulting the documentation, to a single
straightforward shell invocation.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 .travis.yml | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 4afaca313b..ec45d78303 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,20 +22,8 @@ matrix:
       os: osx
       env:
         - PATH="/usr/local/opt/gettext/bin:/usr/local/opt/ccache/libexec:/usr/local/opt/rpcgen/bin:$PATH"
-      before_install:
-        - brew update
-        - brew install ccache rpcgen xz yajl
-      before_script:
-        - ./autogen.sh --prefix=$(pwd)/install-root
       script:
-        # We can't run make distcheck/syntax-check because they
-        # fail on macOS, but doing 'install' and 'dist' gives us
-        # some useful coverage
-        - make -j3 && make -j3 install && make -j3 dist
-      after_failure:
-        - echo '=== LOG FILE(S) START ==='
-        - find -name test-suite.log | xargs cat
-        - echo '=== LOG FILE(S) END ==='
+        /bin/sh -xc "$MACOS_CMD"
 
 script:
   - docker run
@@ -68,6 +56,22 @@ env:
           exit 1
         )
       "
+    # We can't run 'distcheck' or 'syntax-check' because they fail on
+    # macOS, but doing 'install' and 'dist' gives us some useful coverage
+    - MACOS_CMD="
+        brew update &&
+        brew install ccache rpcgen xz yajl &&
+        ./autogen.sh --prefix=\$(pwd)/install-root &&
+        make -j3 &&
+        make -j3 install &&
+        make -j3 dist ||
+        (
+          echo '=== LOG FILE(S) START ==='
+          find -name test-suite.log | xargs cat
+          echo '=== LOG FILE(S) END ==='
+          exit 1
+        )
+      "
     # Please keep this list sorted alphabetically
     - PACKAGES="
         augeas-tools
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux