generalize the deploy script