I want to restart my Spring Boot service, by executing the .jar file I upload with pipeline.
The code below successfully starts the service, but the pipeline doesn't end because it runs on foreground.
- pipe: atlassian/ssh-run:0.2.6
variables:
SSH_USER: $USER
SERVER: $SERVER
COMMAND: 'pkill -9 -f app.jar | .../app.jar'
So I tried below, using nohup command. However, it doesn't start my service. The pipeline says the result succeeded but the service is not being launched.
- pipe: atlassian/ssh-run:0.2.6
variables:
SSH_USER: $USER
SERVER: $SERVER
COMMAND: 'pkill -9 -f app.jar | nohup .../app.jar &'
Someone said when nohup command doesn't work, try putting 'sleep 1' next to it.
- pipe: atlassian/ssh-run:0.2.6
variables:
SSH_USER: $USER
SERVER: $SERVER
COMMAND: 'pkill -9 -f app.jar | nohup .../app.jar & sleep 1'
Now it successfully starts the service. The problem is, the pipeline result says it 'failed', and Bitbucket sends me email about the failed pipeline every time, which is very annoying. (And I can't disable it in settings!)
So I want to know how people use ssh-run command to run background service.
Thank you.
@고현민 now when you figured out with your command, please share the logs where pipeline fails.
It will help us to discover the root cause.
If you have some sensitive info in logs, you may mask any string you'd not like to show up
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.