diff --git a/s2i/bin/assemble b/s2i/bin/assemble index f711cedee10760a835fffa2ec3dffcd14367464a..c6a9e9a8c5db321f2e282b7f14fd94d422506a93 100644 --- a/s2i/bin/assemble +++ b/s2i/bin/assemble @@ -1,27 +1,12 @@ -#!/bin/bash -e -# -# Default STI assemble script for the 'springboot-maven3-centos' image. -# +#!/bin/bash -if [ "$1" = "-h" ]; then - exec /opt/java/bin/usage -fi - -if [ "$(ls /tmp/artifacts/ 2>/dev/null)" ]; then - echo "Restoring build artifacts" - mv /tmp/artifacts/* $HOME/. -fi - -APP_RUNTIME_DIR="${HOME}/src" -APP_SRC_DIR="/tmp/src" +set -e echo "---> Installing application source" -mkdir -p ${APP_RUNTIME_DIR} -cp -Rf ${APP_SRC_DIR}/* ${APP_RUNTIME_DIR}/ +cp -Rf /tmp/src/. ./ -pushd "$APP_RUNTIME_DIR/${APP_ROOT}" >/dev/null echo "---> Building Spring Boot application from source" - mvn clean install -popd >/dev/null +# Fix source directory permissions +fix-permissions ./ diff --git a/s2i/bin/run b/s2i/bin/run index 0a0c785e96cd292915767bc87045abd63c12744a..a01a76a7776c0534f4a4db594c5576e774d77446 100644 --- a/s2i/bin/run +++ b/s2i/bin/run @@ -1,11 +1,6 @@ -#!/bin/bash -e +#!/bin/bash -cd $APP_ROOT_DIR - -# Allow users to inspect/debug the builder image itself, by using: -# $ docker run -i -t codecentric/springboot-maven3-centos --debug -# -[ "$1" == "--debug" ] && exec /bin/bash +set -e echo "---> Starting Spring Boot application" java -jar `find target -name *.jar` diff --git a/s2i/bin/save-artifacts b/s2i/bin/save-artifacts deleted file mode 100644 index 8bff10deb7bc6b64445e6644c26155631aa819b8..0000000000000000000000000000000000000000 --- a/s2i/bin/save-artifacts +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -e - -pushd ${HOME} -if [ -d .m2 ]; then - # all .m2 contents to tar stream - tar cf - .m2 -fi -popd diff --git a/s2i/bin/usage b/s2i/bin/usage index d925fb7f541b62246794d7f4ef1d83339a3c8f3b..990992e953b42cd8fa09bfe5c96b2e8b5aa80bbe 100644 --- a/s2i/bin/usage +++ b/s2i/bin/usage @@ -3,8 +3,12 @@ cat <<EOF This is a STI springboot maven3 centos base image: To use it, install STI: https://github.com/openshift/source-to-image + Sample invocation: + sti build git://github.com/codecentric/spring-boot-sample codecentric/springboot-maven3-centos springboot-app + + You can then run the resulting image via: -docker run -p 8080:8080 sinatra-app +docker run -p 8080:8080 springboot-app EOF