From e4b7123cac573178f65f035f39060a273c527757 Mon Sep 17 00:00:00 2001 From: Samuel Guay Date: Fri, 26 Jul 2024 09:22:51 -0400 Subject: [PATCH] add export version to containers --- .github/workflows/publish_doc.yaml | 1 + .gitignore | 1 + docs/get-started/install.md | 10 ++++++++-- docs/how-to/container.md | 6 +++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_doc.yaml b/.github/workflows/publish_doc.yaml index 036127e4..ba4819cb 100644 --- a/.github/workflows/publish_doc.yaml +++ b/.github/workflows/publish_doc.yaml @@ -51,6 +51,7 @@ jobs: dcm2bids -h > docs_helper/help.txt dcm2bids_helper -h > docs_helper/helper.txt dcm2bids_scaffold -h > docs_helper/help_scaffold.txt + echo "export VERSION=$(dcm2bids -v | awk '/dcm2bids/ {print $3}')" > docs_helper/version.txt - name: Set git credentials run: | diff --git a/.gitignore b/.gitignore index ee1d0b5f..104f9265 100644 --- a/.gitignore +++ b/.gitignore @@ -139,3 +139,4 @@ tests/data/* docs_helper/help.txt docs_helper/help_scaffold.txt docs_helper/helper.txt +docs_helper/version.txt \ No newline at end of file diff --git a/docs/get-started/install.md b/docs/get-started/install.md index 22102614..cd9d7148 100644 --- a/docs/get-started/install.md +++ b/docs/get-started/install.md @@ -16,11 +16,17 @@ You can install it using [Docker][docker] or [Apptainer/Singularity][apptainer]. === "Docker" - `docker pull unfmontreal/dcm2bids:${VERSION}` + ``` + --8<-- "docs_helper/version.txt" + docker pull unfmontreal/dcm2bids:${VERSION} + ``` === "Apptainer/Singularity" - `apptainer pull dcm2bids_${VERSION}.sif docker://unfmontreal/dcm2bids:${VERSION}` + ``` + --8<-- "docs_helper/version.txt" + apptainer pull dcm2bids.sif docker://unfmontreal/dcm2bids:${VERSION} + ``` ## Installing binary executables diff --git a/docs/how-to/container.md b/docs/how-to/container.md index 96f73c0f..9a693577 100644 --- a/docs/how-to/container.md +++ b/docs/how-to/container.md @@ -19,15 +19,19 @@ Before you begin, make sure you have at least one of the following installed: To start, you can either pull the dcm2bids image from the Docker Hub repository or [build it from the Dockerfile in the repository](https://github.com/UNFmontreal/Dcm2Bids/blob/dev/Dockerfile).: + + === "Docker" ``` + --8<-- "docs_helper/version.txt" docker pull unfmontreal/dcm2bids:${VERSION} ``` === "Apptainer/Singularity" ``` + --8<-- "docs_helper/version.txt" apptainer pull dcm2bids_${VERSION}.sif docker://unfmontreal/dcm2bids:${VERSION} ``` @@ -38,7 +42,7 @@ The default command, or the point of entry, for the container is `dcm2bids`. So === "Docker" ``` - docker run --rm -it unfmontreal/dcm2bids:latest --help + docker run --rm -it unfmontreal/dcm2bids:${VERSION} --help ``` === "Apptainer/Singularity"