Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Use travis stages to simplify config #389

Merged
merged 6 commits into from
May 7, 2018

Conversation

pavolloffay
Copy link
Member

@pavolloffay pavolloffay commented Apr 11, 2018

Docs for if statement: https://docs.travis-ci.com/user/conditional-builds-stages-jobs/

Signed-off-by: Pavol Loffay [email protected]

@ghost ghost assigned pavolloffay Apr 11, 2018
@ghost ghost added the review label Apr 11, 2018
@codecov
Copy link

codecov bot commented Apr 11, 2018

Codecov Report

Merging #389 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28d12b7...6883003. Read the comment docs.

@@ -2,8 +2,6 @@

Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I follow this setup. The build shows only two steps now, both from the test stage. Where can we see the logs & status from the deploy stage?

image

Copy link
Member Author

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
Copy link
Member

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: 

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it is correct

Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

Copy link
Member Author

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]>
@pavolloffay
Copy link
Member Author

@yurishkuro PR rebased and updated

@yurishkuro yurishkuro merged commit 4386282 into jaegertracing:master May 7, 2018
@ghost ghost removed the review label May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants