Consolidate common deploy code between qa and production