From 0348f18791d91b11b0144cebe5ee527f290f3895 Mon Sep 17 00:00:00 2001 From: Tang Rufus Date: Wed, 15 Feb 2017 21:32:34 +0800 Subject: [PATCH] TravisCI: Find SauceLabs job id by Travis build number --- .travis.yml | 3 +-- codeception.dist.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index fcbe67d..469cf21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -116,8 +116,7 @@ after_failure: after_script: # Report test result to SauceLabs - - export SAUCE_JOB_NAME="WPBS $TRAVIS_JOB_NUMBER on WP-$WP_VERSION with PHP-$TRAVIS_PHP_VERSION"; - - export SAUCE_JOB_ID=$( curl -u $SAUCE_USERNAME:$SAUCE_ACCESS_KEY https://saucelabs.com/rest/v1/$SAUCE_USERNAME/jobs\?full=true\&format=json | jq ".[] | select(.name == \"$SAUCE_JOB_NAME\") | .id " | sed -e 's/^"//' -e 's/"$//' ) + - export SAUCE_JOB_ID=$( curl -u $SAUCE_USERNAME:$SAUCE_ACCESS_KEY https://saucelabs.com/rest/v1/$SAUCE_USERNAME/jobs\?full=true\&format=json | jq ".[] | select(.build == \"$TRAVIS_JOB_NUMBER\") | .id " | sed -e 's/^"//' -e 's/"$//' ) - "eval \"curl -X PUT -u $SAUCE_USERNAME:$SAUCE_ACCESS_KEY -H \'Content-Type: application/json\' -d \'{ \\\"passed\\\": \"$SAUCE_JOB_RESULT\" }\' https://saucelabs.com/rest/v1/$SAUCE_USERNAME/jobs/$SAUCE_JOB_ID\"" deploy: diff --git a/codeception.dist.yml b/codeception.dist.yml index ee702b0..19e2c60 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -63,7 +63,7 @@ modules: screenResolution: '1024x768' tunnel-identifier: '%TRAVIS_JOB_NUMBER%' name: 'WPBS %TRAVIS_JOB_NUMBER% on WP-%WP_VERSION% with PHP-%TRAVIS_PHP_VERSION%' - build: '%TRAVIS_BUILD_NUMBER%' + build: '%TRAVIS_JOB_NUMBER%' tag: ['PHP-%TRAVIS_PHP_VERSION%', 'WP-%WP_VERSION%', 'WPBS', 'Travis CI', 'CI'] custom-data: commit: %TRAVIS_COMMIT%