#!/bin/bash
set -e
set -u

# checksums
MD5SUM="19e50b22e5ee88314ad6a6630d202277"
MD5SUM_ANNO="da002cc4c9c4f2c77e4401c97564be94"

# run ggsashimi without annotation
docker run --rm -w $PWD -v $PWD:$PWD guigolab/ggsashimi -b examples/input_bams.tsv -c chr10:27040584-27048100 -o ci/sashimi
[[ $(grep -avE 'CreationDate|ModDate' ci/sashimi.pdf | md5sum | awk '{$0=$1}1') == $MD5SUM ]]

# run ggsashimi with annotation
docker run --rm -w $PWD -v $PWD:$PWD guigolab/ggsashimi -g examples/annotation.gtf -b examples/input_bams.tsv -c chr10:27040584-27048100 -o ci/sashimi-anno
[[ $(grep -avE 'CreationDate|ModDate' ci/sashimi-anno.pdf | md5sum | awk '{$0=$1}1') == $MD5SUM_ANNO ]]
#!/bin/bash
set -e
set -u

# checksums
sashimi_md5="86e5924ecf8ce1272635ff43b244b32e"
sashimi_anno_md5="216c07785889074f69cb94cc2af7cb00"

pdfmd5() {
    grep -avE 'CreationDate|ModDate' $1 | md5sum | awk '{$0=$1}1'
}

fail() {
    echo ${1-""} >&2 && exit 1
}

files=( sashimi sashimi_anno )

anno=""
for f in ${files[@]}; do
    [[ $f == "sashimi_anno" ]] && anno="-g examples/annotation.gtf"
    docker run --rm -w $PWD -v $PWD:$PWD guigolab/ggsashimi $anno -b examples/input_bams.tsv -c chr10:27040584-27048100 -o ci/$f
    md5=$(pdfmd5 ci/$f.pdf)
    [[ $md5 == $(eval 'echo $'$f'_md5') ]] || fail "== Wrong checksum for $f.pdf: $md5"
done

echo "== All checksums match"
echo "== DONE"

exit 0
Fix ci script not failing with worng checksum and update checksums
Fix ci script not failing with worng checksum and update checksums
