Skip to content

Commit

Permalink
Merge pull request #490 from genomic-medicine-sweden/version_fix
Browse files Browse the repository at this point in the history
fix: bugfix of version crash when pipeline runs over several days
  • Loading branch information
monikaBrandt authored Sep 25, 2024
2 parents a7589c7 + 48255ed commit 22343da
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ from hydra_genetics.utils.software_versions import touch_software_version_file
from hydra_genetics.utils.software_versions import use_container


hydra_min_version("1.14.0")
hydra_min_version("3.0.0")

min_version("7.13.0")

Expand Down Expand Up @@ -74,20 +74,24 @@ with open(config["output"]) as output:

validate(output_spec, schema="../schemas/output_files.schema.yaml")

date_string = datetime.now().strftime("%Y%m%d")
pipeline_version = get_pipeline_version(workflow, pipeline_name="Twist_Solid")
version_files = touch_pipeline_version_file_name(pipeline_version, date_string=date_string, directory="results/versions/software")
## get version information on pipeline, containers and software

pipeline_name = "Twist_Solid"
pipeline_version = get_pipeline_version(workflow, pipeline_name=pipeline_name)
version_files = touch_pipeline_version_file_name(
pipeline_version, date_string=pipeline_name, directory="results/versions/software"
)
if use_container(workflow):
version_files.append(touch_software_version_file(config, date_string=date_string, directory="results/versions/software"))
version_files.append(touch_software_version_file(config, date_string=pipeline_name, directory="results/versions/software"))
add_version_files_to_multiqc(config, version_files)


onstart:
export_pipeline_version_as_file(pipeline_version, date_string=date_string, directory="results/versions/software")
export_pipeline_version_as_file(pipeline_version, date_string=pipeline_name, directory="results/versions/software")
if use_container(workflow):
update_config, software_info = add_software_version_to_config(config, workflow, False)
export_software_version_as_file(software_info, date_string=date_string, directory="results/versions/software")
export_config_as_file(update_config, date_string=date_string, directory="results/versions")
export_software_version_as_file(software_info, date_string=pipeline_name, directory="results/versions/software")
export_config_as_file(update_config, date_string=pipeline_name, directory="results/versions")


### Set wildcard constraints
Expand Down

0 comments on commit 22343da

Please sign in to comment.