Skip to content

Conversation

@sm-tomislav-civcija
Copy link

@sm-tomislav-civcija sm-tomislav-civcija commented Dec 28, 2020

Travis supports "after_deploy" step that is more appropriate for this use case than "after_script".

It is triggered only if deployment occurs, while after_script is triggered always so you have to put some IF (it reinvents the wheel)

https://docs.travis-ci.com/user/job-lifecycle/#the-job-lifecycle

@Maycon-Santos-sm
Copy link
Contributor

Travis supports "after_deploy" step that is more appropriate for this use case than "after_script".

It is triggered only if deployment occurs, while after_script is triggered always so you have to put some IF (it reinvents the wheel)

https://docs.travis-ci.com/user/job-lifecycle/#the-job-lifecycle

Issue with after_deploy is that only works for pipelines with deploy: key, the after script will work for those that use the script: block to also run deploy

Maybe we can have both examples here with this mention


after_script:
- if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git clone https://github.com/searchmetrics/dd-deploy-metric.git ; bash dd-deploy-metric/dd-deploy-metric.sh; fi
after_deploy:
Copy link
Contributor

@amalioadam amalioadam Dec 28, 2020

Choose a reason for hiding this comment

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

Shouldn't we report metrics only after the story is delivered to production ?

Copy link
Contributor

Choose a reason for hiding this comment

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

It shall be executed only when it's deployed to production.
In that case maybe it makes sense to clarify that the "deploy" phase shall be used only for production deployment.

Copy link
Contributor

Choose a reason for hiding this comment

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

@amalioadam only when its production
@sm-tomislav-civcija its should be after script and not after deploy

Copy link
Contributor

@pmotwani pmotwani left a comment

Choose a reason for hiding this comment

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

@sm-tomislav-civcija should be after script


after_script:
- if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git clone https://github.com/searchmetrics/dd-deploy-metric.git ; bash dd-deploy-metric/dd-deploy-metric.sh; fi
after_deploy:
Copy link
Contributor

Choose a reason for hiding this comment

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

@amalioadam only when its production
@sm-tomislav-civcija its should be after script and not after deploy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants