public function doDeploy($data, $form) {
		$buildName = $form->getSelectedBuild($data);

		// Performs canView permission check by limiting visible projects
		$project = $this->getCurrentProject();
		if(!$project) {
			return new SS_HTTPResponse("Project '" . Convert::raw2xml($this->getRequest()->latestParam('Project')) . "' not found.", 404);
		}

		// Performs canView permission check by limiting visible projects
		$environment = $this->getCurrentEnvironment($project);
		if(!$environment) {
			return new SS_HTTPResponse("Environment '" . Convert::raw2xml($this->getRequest()->latestParam('Environment')) . "' not found.", 404);
		}

		// Initiate the deployment
		// The extension point should pass in: Project, Environment, SelectRelease, buildName
		$this->extend('doDeploy', $project, $environment, $buildName, $data);

		$sha = $project->DNBuildList()->byName($buildName);
		$deployment = DNDeployment::create();
		$deployment->EnvironmentID = $environment->ID;
		$deployment->SHA = $sha->FullName();
		$deployment->write();
		$deployment->start();
		return $this->redirect($deployment->Link());
	}