Skip to content

Commit

Permalink
Initial implementation of metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Nov 5, 2024
1 parent 6c895b6 commit 8cab87e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ deploy_results:
- "collect_results:femc_photon"
- "collect_results:femc_pi0"
script:
- echo "deploy results!"
- snakemake $SNAKEMAKE_FLAGS --cores 1 results/metadata.json
- find results -print | sort | tee summary.txt
- xrdfs $XROOTD_RW_ENDPOINT mkdir $XROOTD_OUTPUT_PREFIX/pipeline-$CI_PIPELINE_ID
- xrdcp -r results $XROOTD_RW_ENDPOINT/$XROOTD_OUTPUT_PREFIX/pipeline-$CI_PIPELINE_ID
Expand Down
20 changes: 20 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,23 @@ rule org2py:
"""
awk -f {input.converter} {input.notebook} > {output}
"""


rule metadata:
output:
"results/metadata.json"
shell:
"""
cat > {output} <<EOF
{{
"CI_COMMIT_REF_NAME": "${{CI_COMMIT_REF_NAME:-}}",
"CI_COMMIT_SHA": "${{CI_COMMIT_SHA:-}}",
"CI_PIPELINE_ID": "${{CI_PIPELINE_ID:-}}",
"CI_PIPELINE_SOURCE": "${{CI_PIPELINE_SOURCE:-}}",
"CI_PROJECT_ID": "${{CI_PROJECT_ID:-}}",
"PIPELINE_NAME": "${{PIPELINE_NAME:-}}"
}}
EOF
# validate JSON
jq '.' {output}
"""

0 comments on commit 8cab87e

Please sign in to comment.