-
Notifications
You must be signed in to change notification settings - Fork 232
Use travis stages to simplify config #389
Use travis stages to simplify config #389
Conversation
Codecov Report
@@ Coverage Diff @@
## master #389 +/- ##
=========================================
Coverage 84.25% 84.25%
Complexity 500 500
=========================================
Files 66 66
Lines 2033 2033
Branches 247 247
=========================================
Hits 1713 1713
Misses 239 239
Partials 81 81 Continue to review full report at Codecov.
|
@@ -2,8 +2,6 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably rename this script to publish-crossdock.sh
.travis.yml
Outdated
script: ./gradlew upload | ||
|
||
- env: [ NAME=deploy-to-dockerhub ] | ||
script: ./travis/build-crossdock.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will appear once it condition in if is true - not a PR request
.travis.yml
Outdated
script: make test-travis && ./gradlew codeCoverageReport && bash <(curl -s https://codecov.io/bash) | ||
|
||
- env: [ NAME=crossdock ] | ||
script: make crossdock-fresh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the indentation correct here? I was expecting something like
- stage: test
- env:
script:
- env:
script:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it is correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it correct though? It seems order dependent. Can we add stage: test
as the first line of the second group, to make it more obvious?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can try, I have copied it from this repo https://github.com/opentracing-contrib/java-spring-cloud/blob/master/.travis.yml#L25 it uses even more stages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like Travis explicitly allows that (i.e. the order matters and stage name is inherited from the previous item). Feels like a bad practice to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works (done in the last commit):
jobs:
include:
- stage: test
env: [ NAME=unit-test ]
script: make test-travis && ./gradlew codeCoverageReport && bash <(curl -s https://codecov.io/bash)
- stage: test
env: [ NAME=crossdock ]
script: make crossdock-fresh
- stage: deploy
env: [ NAME=deploy-to-maven ]
script: ./gradlew upload
- stage: deploy
env: [ NAME=deploy-to-dockerhub ]
script: ./travis/publish-crossdock.sh
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
b0ddadb
to
822803e
Compare
Signed-off-by: Pavol Loffay <[email protected]>
@yurishkuro PR rebased and updated |
Docs for if statement: https://docs.travis-ci.com/user/conditional-builds-stages-jobs/
Signed-off-by: Pavol Loffay [email protected]