Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 7416a46

Browse files
authored
Fixes #1159: Speed up builds by conditionally "returning early". (#1468)
* Fixes #1159: Speed up builds by conditionally "returning early". * Fixing yaml syntax. * Abstracting early exit logic. * Enclosing command.
1 parent 777c1bf commit 7416a46

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ addons:
3232
- svn-5223.devcloud.hosting.acquia.com
3333

3434
before_install:
35+
# Exit build early if only documentation was changed in a Pull Request.
36+
- source ${BLT_DIR}/scripts/travis/exit_early
3537
# Decrypt private SSH key id_rsa_blt.enc, save as ~/.ssh/id_rsa_blt.
3638
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then openssl aes-256-cbc -K $encrypted_c0b166e924da_key -iv $encrypted_c0b166e924da_iv -in id_rsa_blt.enc -out ~/.ssh/id_rsa -d; chmod 600 ~/.ssh/id_rsa; ls -lash ~/.ssh; eval "$(ssh-agent -s)"; ssh-add ~/.ssh/id_rsa; fi
3739
- phpenv config-rm xdebug.ini

scripts/travis/.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ notifications:
4343
# - slack: '<account>:<token>#[channel]'
4444

4545
before_install:
46+
# Exit build early if only documentation was changed in a Pull Request.
47+
- source ${BLT_DIR}/scripts/travis/exit_early
4648
# Disable xdebug.
4749
- phpenv config-rm xdebug.ini
4850
- composer self-update

scripts/travis/exit_early

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)'
4+
then
5+
echo "Only docs were updated, stopping build process."
6+
exit
7+
fi

0 commit comments

Comments
 (0)