Skip to content

Commit

Permalink
common: Adjust TRAVIS_COMMIT_RANGE variable
Browse files Browse the repository at this point in the history
in pull-or-rebuild-image.sh to contain only
commits from a PR.

Ref: travis-ci/travis-ci/issues/4596
  • Loading branch information
igchor committed Mar 14, 2019
1 parent 964549b commit fe87a81
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions utils/docker/pull-or-rebuild-image.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2019, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -85,7 +85,11 @@ fi

# Find all the commits for the current build
if [[ -n "$TRAVIS_COMMIT_RANGE" ]]; then
commits=$(git rev-list $TRAVIS_COMMIT_RANGE)
# $TRAVIS_COMMIT_RANGE contains "..." instead of ".."
# https://github.com/travis-ci/travis-ci/issues/4596
PR_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}"

commits=$(git rev-list $PR_COMMIT_RANGE)
else
commits=$TRAVIS_COMMIT
fi
Expand Down

0 comments on commit fe87a81

Please sign in to comment.