Skip to content

Commit c0a9e71

Browse files
committed
Add --update flag to containers-add call to be able to update, but skip alpha/beta versions for now
1 parent f46580a commit c0a9e71

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/create_singularities

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
# THE SOFTWARE.
2727
#
2828

29+
#
30+
# TODOs when get to refactor this prototype
31+
# - add options to
32+
# - skip getting an image (datalad containers-add call)
33+
2934
set -eu
3035

3136
IMAGES_DIR="images"
@@ -55,7 +60,10 @@ function get_last_docker_version_tag() {
5560
# \2 works in one case, \4 in the other ;)
5661
# | sed -n -r 's/^([Vv]?(([0-9]{1,10}\..*))|((master|latest)$))/\1 \2\4/gp'
5762
# sort -V is not disregarding v prefix, so we do store pure version and original tag in the same line
58-
good_versions=$(echo "$versions" | sed -n -r 's/^([Vv]?(([0-9]{1,10}\..*))|((master)$))/\2\4@\1/gp')
63+
# Some release alpha releases, so probably would skip thos for now
64+
good_versions=$(echo "$versions" \
65+
| grep -v '[ab][0-9][0-9]*$' \
66+
| sed -n -r 's/^([Vv]?(([0-9]{1,10}\..*))|((master)$))/\2\4@\1/gp')
5967
last_version=$(echo -e "$good_versions" |sort -Vr |head -n 1)
6068
elif [ -z "$versions" ]; then
6169
info $dh no version. Tags: $versions
@@ -122,6 +130,7 @@ function get_image_for_singularity_file() {
122130
# {img_dspath} handling needs https://github.com/datalad/datalad-container/issues/72 TODO WiP
123131
datalad containers-add "$name" \
124132
-i "$imagefile" \
133+
--update \
125134
--call-fmt '{img_dspath}/scripts/singularity_cmd run {img} {cmd}' \
126135
-u shub://ReproNim/containers:$singtag \
127136
|| error "No image $imagefilename was found yet"

0 commit comments

Comments
 (0)