Skip to content

Commit 8c686ca

Browse files
korydraughnalanking
authored andcommitted
[#169] Improved support for automated builds.
For environments where there is no TTY device, build_jar.sh can be passed --non-interactive. This instructs the script to launch a docker container without the -i and -t options.
1 parent 6f316fc commit 8c686ca

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The following instructions assume you're running Ubuntu 18.04 and Bash.
2121
### Building (from source)
2222
```bash
2323
$ cd /path/to/irods_client_nfsrods
24-
$ bash build_jar.sh
24+
$ bash build_jar.sh # Consider passing --non-interactive if building in an environment without TTY support.
2525
$ docker build -t local/nfsrods .
2626
```
2727

build_jar.sh

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
11
#! /bin/bash
22

3+
usage() {
4+
cat <<_EOF_
5+
USAGE: bash build_jar.sh [OPTIONS]
6+
7+
Builds a runnable NFSRODS JAR file based on the currently checked out source.
8+
9+
Options:
10+
--non-interactive Launches docker container without -i and -t.
11+
-h, --help Shows this message.
12+
_EOF_
13+
exit
14+
}
15+
16+
docker_run_iteractive_options="-it"
17+
18+
while [ -n "$1" ]; do
19+
case "$1" in
20+
--non-interactive) shift; unset docker_run_iteractive_options;;
21+
-h|--help) usage;;
22+
esac
23+
shift
24+
done
25+
326
# Compiles an executable JAR file from the local repository and
427
# stores all build artifacts in local_maven_repo.
528
#
629
# The local_maven_repo directory keeps your personal maven repository
730
# (i.e. $HOME/.m2) clean and safe from the "root" user.
8-
docker run -it --rm --name nfsrods_builder \
31+
docker run ${docker_run_iteractive_options} --rm --name nfsrods_builder \
932
-v $PWD/local_maven_repo:/root/.m2 \
1033
-v $PWD:/irods_client_nfsrods \
1134
-w /irods_client_nfsrods \

0 commit comments

Comments
 (0)