jervis icon indicating copy to clipboard operation
jervis copied to clipboard

after_success, after_failure, after_script don't work

Open aleksandrlat opened this issue 6 years ago • 7 comments

This wiki page https://github.com/samrocketman/jervis/wiki/Build-overview is confusing about after_success: some command after_failure: some command after_script: some command

I could make this sections work. Also I don't see in code they are executed.

aleksandrlat avatar Jun 04 '18 22:06 aleksandrlat

Hi @aleksandrlat, thanks for the report. I’m aware they aren’t implemented. Some of the documentation is a reproduction (not literal but reference) of Travis CI documentation. I will continue to evaluate but at this time I don’t have a plan to implement them. That functionality is easily replicated in bash without relying on YAML. Here’s an example.

function execute_after() {
    if [[ "$1" -eq 0 ]]; then
        # after success commands
    else
        # after failure commands
    if
    # after script commands
}
trap 'execute_after $?' EXIT
# start your build here

Because of this I decided implementing after_success and after_failure to be not very useful. I can either update the documentation or even possibly re-evaluate implementing it. Just giving you context.

samrocketman avatar Jun 05 '18 00:06 samrocketman

@samrocketman I started to use Jervis and found docs confusing. Thank you for explanation!

I think you can keep this issue as reminder to do something with it. Or you can close it if you want.

aleksandrlat avatar Jun 05 '18 00:06 aleksandrlat

I’ll keep it open because I’m still not sure about not implementing it. However, I have updated the wiki and linked to this issue as an explanation. Right now, I’m focused on fixing broken functionality before adding something like this. I’ll keep this open for a rainy day :-)

samrocketman avatar Jun 05 '18 01:06 samrocketman

@aleksandrlat I updated the example in my comment above to also note “after script”.

samrocketman avatar Jun 05 '18 01:06 samrocketman

Hi @samrocketman, thanks for updating the docs, we had several teams in our company asking around why would those entries not be called. Apparently it's a popular feature but I totally agree with you fixing broken stuff is certainly more important. BTW congrats on the great work.

robertobado avatar Jun 13 '18 19:06 robertobado

@aleksandrlat @robertobado do you expect this to behave like Travis CI?

For example, with a matrix build "after" builds occur after each matrix build and not after the overall build.

samrocketman avatar Jun 14 '18 12:06 samrocketman

Matrix build is used quite rarely in my company's case and none of the pipelines I saw using matrix build required "afters" until now. My suggestion would be to go with the easiest approach to implement. If single and multiple "afters" will demand the same effort, multiple looks more robust for me, but if single is easier to implement, that would be enough from our perspective.

robertobado avatar Jun 14 '18 22:06 robertobado