Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ATM we are pure bash scripts but eventually might RF into Python
language: python


install:
# 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
12 changes: 6 additions & 6 deletions scripts/create_singularities
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

@yarikoptic yarikoptic Jun 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not 100% certain that separating this way wouldn't cause some values to be interpreted as options to echo, but seems to be not:

$> cat /tmp/checkecho
#!/bin/bash
echo -e "I1: $@"
echo -e "I2:" "$@"

$> /tmp/checkecho '-n' 1 "2 3" '&' '${var}'
I1: -n 1 2 3 & ${var}
I2: -n 1 2 3 & ${var}

so all good

}



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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down