Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do you start a background process with pipeline ssh-run?

Edited

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.

1 answer

0 votes

@고현민 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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Trello

Taco Tuesday: Your favorite Trello blog takeaway

Hello friends! From the community that brought you Welcome Wednesday, Throwback Thursday and Friday Fun, welcome to Taco Tuesday, a weekly discussion about all things Trello. The best part? One Tac...

66 views 4 3
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you