Skip to content

Commit b78b012

Browse files
Skip Travis CI deploy job earlier
1 parent 680ddb7 commit b78b012

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ jobs:
9595
- git diff --stat --exit-code .travis.yml
9696

9797
- stage: Deploy
98+
before_script:
99+
- |
100+
if ! git diff --name-only "$TRAVIS_COMMIT_RANGE" -- | grep -Eq "Dockerfile$"; then
101+
echo "Skip deployment as none of the Dockerfiles has been changed."
102+
exit
103+
fi
98104
script:
99105
- ./generate-stackbrew-pr.sh "$TRAVIS_COMMIT_RANGE"
100106

travis.yml.template

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ jobs:
9393
- git diff --stat --exit-code .travis.yml
9494

9595
- stage: Deploy
96+
before_script:
97+
- |
98+
if ! git diff --name-only "$TRAVIS_COMMIT_RANGE" -- | grep -Eq "Dockerfile$"; then
99+
echo "Skip deployment as none of the Dockerfiles has been changed."
100+
exit
101+
fi
96102
script:
97103
- ./generate-stackbrew-pr.sh "$TRAVIS_COMMIT_RANGE"
98104

0 commit comments

Comments
 (0)