Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
- docker
env:
matrix:
- MODE=branchStrategy
- MODE=syntax
- MODE=python
- MODE=node
Expand Down Expand Up @@ -66,6 +67,10 @@ script:
if [[ $MODE == 'java' ]]; then
$DOCKER_CMD Azure/azure-libraries-for-java -v
fi
- >-
if [[ $MODE == 'branchStrategy']]; then
[[ $TRAVIS_PULL_REQUEST && $TRAVIS_PULL_REQUEST == 'Azure/azure-rest-api-specs-pr' && $TRAVIS_BRANCH == 'master' ]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Since I am new to this, should you also check $TRAVIS_BRANCH for null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant stuff from here: https://docs.travis-ci.com/user/environment-variables/

TRAVIS_BRANCH:
for push builds, or builds not triggered by a pull request, this is the name of the branch.
for builds triggered by a pull request this is the name of the branch targeted by the pull request.
for builds triggered by a tag, this is the same as the name of the tag (TRAVIS_TAG).

TRAVIS_PULL_REQUEST: The pull request number if the current job is a pull request, “false” if it’s not a pull request.

TRAVIS_PULL_REQUEST_SLUG:
if the current job is a pull request, the slug (in the form owner_name/repo_name) of the repository from which the PR originated.
if the current job is a push build, this variable is empty ("").

TRAVIS_REPO_SLUG: The slug (in form: owner_name/repo_name) of the repository currently being built.

Looks like I do have a typo though! For the second clause, I meant to have it be $TRAVIS_PULL_REQUEST_SLUG not $TRAVIS_PULL_REQUEST. Looking at it again though, I'll just use $TRAVIS_REPO_SLUG.

fi
- >-
if [[ $MODE == 'syntax' ]]; then
npm test -- test/syntax.js
Expand Down