generalizing the deploy script