Skip to content
Ilya Radchenko edited this page Jun 19, 2015 · 7 revisions

On the same server as Strider

Ubuntu/Upstart/Nginx

Use the strider-custom plugin. From there open the custom options and in the Deploy section put the following:

check_upstart_service(){
    sudo status $1 | grep -q "^$1 start" > /dev/null
    return $?
}

# optional build/install steps might go here
sudo rm -rf /var/www/myapp.com
sudo cp -r $PWD /var/www/myapp.com

if check_upstart_service myapp.com; then
	sudo stop myapp.com
	sudo start myapp.com
else
	sudo start myapp.com
fi

The above assumes that you have an nginx config in sites-enabled called myapp.com and you also have an upstart config called myapp.com. Your application is also copied to /var/www/myapp.com. You can also have a build step here, like npm run build (if using nodejs).

Note: Make sure that the Custom plugin is after your main application plugin in the plugins page, on the enabled side. Also remove the comment in the script, or you might see weird behavior.