From f3da1c75f3a3bb9de6623b920bb4c571928cea3c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 24 Jun 2019 14:30:23 -0400 Subject: [PATCH 1/3] BF: address shellcheck concerns: "", :upper/lower for tr, -r for read --- scripts/create_singularities | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/create_singularities b/scripts/create_singularities index 375a8d22e..70b0af7ec 100755 --- a/scripts/create_singularities +++ b/scripts/create_singularities @@ -37,22 +37,22 @@ IMAGES_DIR="images" function debug() { - : # echo -e "D: $@" >&2 + : # echo -e "D:" "$@" >&2 } function info() { - echo -e "I: $@" >&2 + echo -e "I:" "$@" >&2 } function error() { - echo -e "E: $@" >&2 + echo -e "E:" "$@" >&2 } function get_last_docker_version_tag() { dh="$1" - j=$(curl -s -k https://registry.hub.docker.com/v1/repositories/$dh/tags) + j=$(curl -s -k "https://registry.hub.docker.com/v1/repositories/$dh/tags") versions=$(echo "$j" | jq -c '.[]["name"]' | sed -e 's,",,g' | sort -Vr) nversions=$(echo "$versions" | wc -l) if [ "$nversions" -gt 1 ]; then @@ -187,7 +187,7 @@ function add_singularity_versioned_image() { function generate_singularity_for_docker_image() { githubid="$1" - dockerhubid="$(echo "$githubid" | tr 'A-Z' 'a-z')" + dockerhubid="$(echo "$githubid" | tr '[:upper:]' '[:lower:]')" family="$2" info "$family <- docker $dockerhubid" @@ -234,7 +234,7 @@ function add_singularity_image_from_collection() { curl -s -k https://raw.githubusercontent.com/BIDS-Apps/bids-apps.github.io/master/_config.yml \ | awk '/^ *dh:/{print $2}' \ | sed -e "s,',,g" \ - | while read dockerhubid; do + | while read -r dockerhubid; do generate_singularity_for_docker_image "$dockerhubid" "bids" done From c884dbc0a37b762bafbf1609651985d8be1c286d Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 24 Jun 2019 14:31:21 -0400 Subject: [PATCH 2/3] ENH: rudimentary .travis.yml looking in the future so installing bats and singularity as well --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..daca3c5c7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +# ATM we are pure bash scripts but eventually might RF into Python +language: python + + +install: + - travis_retry sudo apt-get install singularity-container shellcheck bats + +script: + - shellcheck scripts/create_singularities From 1266eaa9a6854ae1bc9b078008c03ec9dac33c11 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 24 Jun 2019 14:43:10 -0400 Subject: [PATCH 3/3] ENH: use neurodebian repo --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index daca3c5c7..e00895d6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,11 @@ language: python install: - - travis_retry sudo apt-get install singularity-container shellcheck bats + # So we get all backports etc + - bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh) + - travis_retry sudo apt-get update -qq + - travis_retry sudo apt-get install eatmydata # to speedup some installations + - travis_retry sudo eatmydata apt-get install singularity-container shellcheck bats script: - shellcheck scripts/create_singularities