File tree Expand file tree Collapse file tree 6 files changed +55
-1
lines changed Expand file tree Collapse file tree 6 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ sanity_checks() {
8484 # Reset some vars
8585 for binary in gawk grep sed; do
8686 if ! which $binary >& /dev/null; then
87- echo " $UNKNOWN : $binary binary not found in path. Aborting."
87+ echo " ERROR : $binary binary not found in path. Aborting."
8888 exit 1
8989 fi
9090 done
Original file line number Diff line number Diff line change 1+ log=testlog.log
2+
3+ # Fedora
4+ export IMAGE=json-path-fedora-bash
5+ cp test/docker/Dockerfile-fedora test/docker/Dockerfile
6+ ./test/docker/wrap_in_docker.sh ./all-tests.sh | tee $log
7+
8+ a=$( grep ' test(s) failed' $log )
9+
10+ # Ubuntu
11+ export IMAGE=json-path-ubuntu-bash
12+ cp test/docker/Dockerfile-ubuntu test/docker/Dockerfile
13+ ./test/docker/wrap_in_docker.sh ./all-tests.sh | tee $log
14+
15+ b=$( grep ' test(s) failed' $log )
16+
17+ # Centos
18+ export IMAGE=json-path-centos-bash
19+ cp test/docker/Dockerfile-centos test/docker/Dockerfile
20+ ./test/docker/wrap_in_docker.sh ./all-tests.sh | tee $log
21+
22+ c=$( grep ' test(s) failed' $log )
23+
24+ rm $log
25+
26+ echo
27+ echo " Fedora tests"
28+ echo $a
29+ echo " Ubuntu tests"
30+ echo $b
31+ echo " Centos tests"
32+ echo $c
Original file line number Diff line number Diff line change 1+ FROM centos
2+
3+ RUN yum -y install python2 diffutils which
Original file line number Diff line number Diff line change 1+ FROM fedora
2+
3+ RUN dnf -y install python diffutils which
Original file line number Diff line number Diff line change 1+ FROM ubuntu
2+
3+ RUN apt-get update && apt-get -y install python gawk
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ IMAGE=${IMAGE:- json-path-bash}
5+
6+ readonly script_dir=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
7+ readonly RUN_ARGS=" $@ "
8+ readonly target_image=$IMAGE
9+
10+ docker build -t " $target_image " " $script_dir "
11+
12+ docker run --rm -v " $( pwd) :/localdir" -i " $target_image " sh -c " cd /localdir && $RUN_ARGS "
13+
You can’t perform that action at this time.
0 commit comments