diff options
author | drecchia <danilo@deltatecnologia.com> | 2016-06-09 20:35:24 -0300 |
---|---|---|
committer | drecchia <danilo@deltatecnologia.com> | 2016-06-09 20:35:24 -0300 |
commit | 049bab3bdb25acdf4f0c8cf4eb8cad200b860066 (patch) | |
tree | e86f297ff8110ac7bd5800643c7067ff9d40a242 /setup/docker/build.sh | |
parent | 3f19cd0c34e5454f5f1feed3465c45ac638cb0d2 (diff) | |
download | trackermap-server-049bab3bdb25acdf4f0c8cf4eb8cad200b860066.tar.gz trackermap-server-049bab3bdb25acdf4f0c8cf4eb8cad200b860066.tar.bz2 trackermap-server-049bab3bdb25acdf4f0c8cf4eb8cad200b860066.zip |
- Docker build script.
Diffstat (limited to 'setup/docker/build.sh')
-rw-r--r-- | setup/docker/build.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/setup/docker/build.sh b/setup/docker/build.sh new file mode 100644 index 000000000..31ee60a03 --- /dev/null +++ b/setup/docker/build.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +which mvn &> /dev/null || { echo >&2 "Maven package cant be found on path. Aborting."; exit 1; } +which awk &> /dev/null || { echo >&2 "Awk package cant be found on path. Aborting."; exit 1; } +which docker &> /dev/null || { echo >&2 "Docker package cant be found on path. Aborting."; exit 1; } +mvn package || { echo >&2 "Maven package has failed. Aborting."; exit 1; } + +export company="tananaev" +export software="traccar" +export version=$(head -n 10 ./pom.xml |grep version|cut -d ">" -f2|cut -d"<" -f1) + +tmp="./setup/docker/tmp" + +mkdir -p ${tmp} + +cat ./setup/unix/traccar.xml | awk '/web.path/ && !modif { printf(" <entry key=\"web.debug\">true</entry>\n"); modif=1 } {print}' > ${tmp}/traccar.xml +cp -rf ./schema ${tmp}/schema +cp -rf ./target/tracker-server.jar ${tmp}/traccar-server.jar +cp -rf ./target/lib ${tmp}/lib +cp -rf ./web ${tmp}/web + +docker build -t ${company}/${software}:${version} ./setup/docker/ + +rm -rf ${tmp}
\ No newline at end of file |