| 1 | #!/bin/sh |
| 2 | if [ "$#" -ne 1 ]; then |
| 3 | echo "usage: $0 <docker-image-ref>" |
| 4 | echo "runs this test on image matching <docker-image-ref>" |
| 5 | exit 1 |
| 6 | fi |
| 7 | |
| 8 | # this tag is used by the dockerfiles in |
| 9 | # {data, server, client, bootstrap} |
| 10 | tag=zaqwsx_ipfs-test-img |
| 11 | |
| 12 | # could use set -v, but i don't want to see the comments... |
| 13 | |
| 14 | img=$(docker images | grep $1 | awk '{print $3}') |
| 15 | echo "using docker image: $img ($1)" |
| 16 | |
| 17 | echo docker tag -f $img $tag |
| 18 | docker tag -f $img $tag |
| 19 | |
| 20 | echo "fig build --no-cache" |
| 21 | fig build --no-cache |
| 22 | |
| 23 | echo "fig up --no-color | tee build/fig.log" |
| 24 | fig up --no-color | tee build/fig.log |
| 25 | |
| 26 | # save the ipfs logs for inspection |
| 27 | echo "make save_logs" |
| 28 | make save_logs || true # don't fail |
| 29 | |
| 30 | # save the ipfs logs for inspection |
| 31 | echo "make save_profiling_data" |
| 32 | make save_profiling_data || true # don't fail |
| 33 | |
| 34 | # fig up won't report the error using an error code, so we grep the |
| 35 | # fig.log file to find out whether the call succeeded |
| 36 | echo 'tail build/fig.log | grep "exited with code 0"' |
| 37 | tail build/fig.log | grep "exited with code 0" |