Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script_stop = true - does not stop script after first failure #233

Closed
jpdoria opened this issue Mar 28, 2023 · 15 comments · Fixed by #237
Closed

script_stop = true - does not stop script after first failure #233

jpdoria opened this issue Mar 28, 2023 · 15 comments · Fixed by #237
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@jpdoria
Copy link

jpdoria commented Mar 28, 2023

Hi,

We have a step in our deployment pipeline that needs to be stopped right away on failure. I saw there's a script_stop option so I'm following the Stop script after first failure example and I applied it on my test pipeline but it doesn't seem to work - the step still runs after failing and pipeline has been running for an hour now. Could you please help me resolve this? I'm using this appleboy/[email protected]. Thanks so much!
image
image

@appleboy
Copy link
Owner

appleboy commented Apr 4, 2023

I will take it.

@appleboy appleboy added bug Something isn't working question Further information is requested labels Apr 4, 2023
@appleboy
Copy link
Owner

appleboy commented Apr 4, 2023

@jpdoria Please post your console log. The following is my testing log:

image

@appleboy appleboy removed the bug Something isn't working label Apr 4, 2023
@appleboy appleboy self-assigned this Apr 4, 2023
@jpdoria
Copy link
Author

jpdoria commented Apr 4, 2023

@appleboy here's the post log:

image

In your test result above, were you also using script_stop: true and sync: true?

@appleboy
Copy link
Owner

appleboy commented Apr 4, 2023

image

      with:
        host: ${{ secrets.HOST }}
        username: ${{ secrets.USERNAME }}
        key: ${{ secrets.KEY }}
        port: ${{ secrets.PORT }}
        script_stop: true
        script: |
          mkdir abc/def
          ls -al

@appleboy
Copy link
Owner

appleboy commented Apr 4, 2023

Your console can't get the log message from ls -al command so I think script_stop is working.

@jpdoria
Copy link
Author

jpdoria commented Apr 4, 2023

@appleboy, can you also try to use script_stop: true and sync: true? I think that's breaking the pipeline. Without the latter option, I was able to run it successfully.

@appleboy
Copy link
Owner

appleboy commented Apr 4, 2023

@jpdoria let me try it.

@appleboy
Copy link
Owner

appleboy commented Apr 4, 2023

@jpdoria

image

You got the same problem as above?

@jpdoria
Copy link
Author

jpdoria commented Apr 4, 2023

@appleboy Yes, that's right. My pipeline took longer so I had to cancel it. In my screenshot above, I left it running for an hour just to see what would happen next but it got stuck.

@appleboy
Copy link
Owner

appleboy commented Apr 4, 2023

@jpdoria I can reproduce the problem. I will take it.

@appleboy appleboy added the bug Something isn't working label Apr 4, 2023
appleboy added a commit to appleboy/drone-ssh that referenced this issue Apr 4, 2023
- Add `trimValues` function for cleaning up slice values
- Remove unused `wg.Done()` call
- Modify `Exec` function to launch goroutines for each host in `Config.Host`
- Add test for `ScriptStop` with multiple hosts and sync mode

refer to: appleboy/ssh-action#233
@appleboy
Copy link
Owner

appleboy commented Apr 4, 2023

@jpdoria Please help to try the following version.

uses: appleboy/ssh-action@5c089138a7db482bed7054e891898491832c129a

@jpdoria
Copy link
Author

jpdoria commented Apr 4, 2023

Thanks for the quick fix! script_stop: true and sync: true are both working fine now! 🎉

@appleboy
Copy link
Owner

appleboy commented Apr 4, 2023

@jpdoria I will bump new version.

appleboy added a commit that referenced this issue Apr 4, 2023
- Update Dockerfile to use a newer version of `drone-ssh`
- Modify `ci.yml` to use `continue-on-error` instead of commenting out code

fix #233
@appleboy
Copy link
Owner

appleboy commented Apr 4, 2023

Bump new version v0.1.9

uses: appleboy/[email protected]

@jpdoria
Copy link
Author

jpdoria commented Apr 4, 2023

Sweet! Thanks so much, @appleboy! Really appreciate it! 🙌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants