forked from dnanexus/dxCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·32 lines (26 loc) · 895 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -euo pipefail
# This tests that the Dockerfile produces a valid Docker image with Java and
# dxCompiler installed, based on the dxCompiler version specified in docker.env
# (not necessarily the latest version being released, as it isn't yet published).
# Find the root directory of the distribution, regardless of where
# the script is called from
base_dir=$(dirname "$0")
source "${base_dir}/docker.env"
if [[ -z "${VERSION}" ]]; then
echo "Specify the dxCompiler version in docker.env"
exit 1
fi
if ! bash "${base_dir}/docker_build.sh" 2>&1
then
echo "Docker image build failed"
exit 1
fi
output=$(bash "${base_dir}/docker_run.sh" version 2>&1)
echo "Output from running dxCompiler Docker image to check version:"
echo "${output}"
if ! echo "${output}" | grep -q "${VERSION}"
then
echo "Expected dxCompiler version ${VERSION}, output was ${output}"
exit 1
fi