def publish(self, override_versioned: bool): """Copy documentation packages files to airflow-site repository.""" console.print(f"Publishing docs for {self.package_name}") output_dir = os.path.join(AIRFLOW_SITE_DIR, self._publish_dir) pretty_source = pretty_format_path(self._build_dir, os.getcwd()) pretty_target = pretty_format_path(output_dir, AIRFLOW_SITE_DIR) console.print(f"Copy directory: {pretty_source} => {pretty_target}") if os.path.exists(output_dir): if self.is_versioned: if override_versioned: console.print( f"Overriding previously existing {output_dir}! ") else: console.print( f"Skipping previously existing {output_dir}! " f"Delete it manually if you want to regenerate it!") console.print() return shutil.rmtree(output_dir) shutil.copytree(self._build_dir, output_dir) if self.is_versioned: with open(os.path.join(output_dir, "..", "stable.txt"), "w") as stable_file: stable_file.write(self._current_version) console.print()
def publish(self): """Copy documentation packages files to airflow-site repository.""" print(f"Publishing docs for {self.package_name}") output_dir = os.path.join(AIRFLOW_SITE_DIR, self._publish_dir) pretty_source = pretty_format_path(self._build_dir, os.getcwd()) pretty_target = pretty_format_path(output_dir, AIRFLOW_SITE_DIR) print(f"Copy directory: {pretty_source} => {pretty_target}") shutil.copytree(self._build_dir, output_dir) print()
def publish(self): """Copy documentation packages files to airflow-site repository.""" print(f"Publishing docs for {self.package_name}") output_dir = os.path.join(AIRFLOW_SITE_DIR, self._publish_dir) pretty_source = pretty_format_path(self._build_dir, os.getcwd()) pretty_target = pretty_format_path(output_dir, AIRFLOW_SITE_DIR) print(f"Copy directory: {pretty_source} => {pretty_target}") shutil.copytree(self._build_dir, output_dir) if self.is_versioned: with open(os.path.join(output_dir, "..", "stable.txt"), "w") as stable_file: stable_file.write(self._current_version) print()