Skip to content

Commit dc4f099

Browse files
authored
Update before_script to make it work with tags
1 parent 04dec7e commit dc4f099

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.travis/before_script.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ cd magento2
2424
# add composer package under test, composer require will trigger update/install
2525
composer config minimum-stability dev
2626
composer config repositories.travis_to_test git https://github.com/$TRAVIS_REPO_SLUG.git
27-
#TODO make it work with tags as well:
28-
composer require ${COMPOSER_PACKAGE_NAME}:dev-${TRAVIS_BRANCH}\#{$TRAVIS_COMMIT}
27+
28+
if [ ! -z $TRAVIS_TAG ]
29+
then
30+
composer require ${COMPOSER_PACKAGE_NAME}:${TRAVIS_TAG}
31+
else
32+
composer require ${COMPOSER_PACKAGE_NAME}:dev-${TRAVIS_BRANCH}\#${TRAVIS_COMMIT}
33+
fi
2934

3035
# prepare for test suite
3136
case $TEST_SUITE in
@@ -47,4 +52,4 @@ case $TEST_SUITE in
4752
unit)
4853
cp vendor/$COMPOSER_PACKAGE_NAME/tests/Unit/phpunit.xml.dist dev/tests/unit/phpunit.xml
4954
;;
50-
esac
55+
esac

0 commit comments

Comments
 (0)