$TRAVIS_COMMIT_RANGE does not contain all changed files


#1

Hi, if I commit these two files .travis.yml & samtools/Dockerfile:

$ git diff --name-only
.travis.yml
samtools/Dockerfile

Then within the travis build only the .travis.yml is detected from the $TRAVIS_COMMIT_RANGE

$ CHANGED_FILES=($(git diff --name-only $TRAVIS_COMMIT_RANGE))
The command "CHANGED_FILES=($(git diff --name-only $TRAVIS_COMMIT_RANGE))" exited with 0.

$ echo $CHANGED_FILES
.travis.yml

I think this is something to do with the $TRAVIS_COMMIT_RANGE variable.
Does anyone know what may be causing this and how to solve it?
Any help would be much appreciated, many thanks in advance.

Here is my full .travis.yml file for reference:

sudo: required
language: python
jdk: openjdk8
services: docker
python: "3.6"
cache: pip
matrix:
  fast_finish: true

script:
  # get list of changed files
  - CHANGED_FILES=($(git diff --name-only $TRAVIS_COMMIT_RANGE))
  # save names of any changed folders (docker containers) to file folders.txt
  - echo $CHANGED_FILES
  - for file in $CHANGED_FILES; do
    echo $file;
    dir=$(dirname $file);
    echo $dir;
    [[ "${dir}" != "." ]] && dirname $file >> folders.txt;
    done
  # for all changed folders (docker containers) in folders.txt pull containers
  - "[ ! -f folders.txt ] || while read folder; do
    echo $folder;
    docker pull lifebitai/${folder};
    done <folders.txt"

#2

Please point to the build log, so we can take a look. Thanks.


#3

Hi BanzaiMan,

Unfortunately, the repository & therefore I guess the build log is private. Do you have any idea what might be causing the issue?


#4

Without access to the code, it is very hard to understand the problem, I’m afraid. There are a few open issues with $TRAVIS_COMMIT_RANGE, which may or may not be related. https://github.com/travis-ci/travis-ci/issues?q=is%3Aissue+travis_commit_range+is%3Aopen (These will eventually be migrated here.)