[libvirt] [PATCH 1/2] travis: move macOS before_install tasks into osx matrix entry

Daniel P. Berrangé posted 2 patches 7 years, 1 month ago
[libvirt] [PATCH 1/2] travis: move macOS before_install tasks into osx matrix entry
Posted by Daniel P. Berrangé 7 years, 1 month ago
The list of commands we're running for the before_install task
is rather large. We have it all on one line because we're
wrapping it all in a test against TRAVIS_OS_NAME env variable.

By moving it into the osx matrix entry we can remove the need
for the conditional shell test. This lets us put each command
on a separate line making the steps clear to understand.

Fortunately the 'before_install' task does not have the crazy
behaviour whereby travis ignores errors and runs all commands
regardless, like the 'script' task does. The first command
failing will cause an immediate stop with error status.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 .travis.yml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 79f30f3090..9801981eca 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,6 +14,11 @@ matrix:
         - DISTCHECK_CONFIGURE_FLAGS="--with-init-script=systemd"
     - compiler: clang
       os: osx
+      before_install:
+        - brew update
+        - brew upgrade
+        - brew install rpcgen yajl xz
+        - brew link --force python@2
       script:
         # We can't run make distcheck/syntax-check because they
         # fail on macOS, but doing 'install' and 'dist' gives us
@@ -99,9 +104,6 @@ env:
     - PATH="/usr/local/opt/gettext/bin:/usr/local/opt/rpcgen/bin:$PATH"
     - VIR_TEST_DEBUG=1
 
-before_install:
-  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update && brew upgrade && brew install rpcgen yajl xz && brew link --force python@2; fi
-
 before_script:
   - ./autogen.sh --prefix=$(pwd)/install-root
 
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/2] travis: move macOS before_install tasks into osx matrix entry
Posted by Andrea Bolognani 7 years, 1 month ago
On Thu, 2018-03-15 at 13:33 +0000, Daniel P. Berrangé wrote:
> The list of commands we're running for the before_install task
> is rather large. We have it all on one line because we're
> wrapping it all in a test against TRAVIS_OS_NAME env variable.
> 
> By moving it into the osx matrix entry we can remove the need
> for the conditional shell test. This lets us put each command
> on a separate line making the steps clear to understand.
> 
> Fortunately the 'before_install' task does not have the crazy
> behaviour whereby travis ignores errors and runs all commands
> regardless, like the 'script' task does. The first command
> failing will cause an immediate stop with error status.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  .travis.yml | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Reviewed-by: Andrea Bolognani <abologna@redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization

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