Update template and extract deploy script