Deployment successful message is triggered but server is not started yet

Hi,

 

I noticed the following: we are using Bamboo to deploy a webserver. The last step in the deployment is to start the webserver. However Bamboo is considering the deployment to be successful immediately after the server start command has been given (tomcat on linux being started with command 'catalina.sh start'). The server however is still starting up for a few minutes. This causes problems when using triggers + we have to manually check the log to see if the server has really started.

Is there a way to have Bamboo consider a deployment successful only after the server has actually fully started?

thanks and regards

1 answer

1 accepted

0 vote

Hi Pieter,

 

The Bamboo considers the deployment to be successful because the return code by the command "catalina.sh start" will always (unless there is some error upon executing this command for example if the shell file does not have executable permissions then it will throw an error and the return code will be 1) return 0 (which is a success).

 

So to achieve your requirement here, you have to script a task to

1. Execute the "catalina.sh start" command.

2. In a loop keep searching for the string such as "tomcat started" in the tomcat logs to check the startup of the tomcat.

3. Once the "tomcat started" text is grepped from the tomcat logs, exit the loop to end the script task.

_Also make sure you have a counter here so that after a certain interval of time if the script is not able to get the "tomcat started" text the process will timeout and the deployment should fail._

 

Something like:

sh catalina.sh start

for loop to check for the text (say 5 times) with gap of 20 seconds each (sleep 20)

if the system couldn't manage to get the string:

exit -1

else

success

 

Thanks!

Robhit

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,561 views 0 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you