Commit 783c68de by Benedikt

Implement s2i scripts according to openshift/sti-ruby (which seems to be more up…

Implement s2i scripts according to openshift/sti-ruby (which seems to be more up to date than openshift/ruby-20-centos)
parent 41075f12
#!/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 ./
#!/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`
#!/bin/bash -e
pushd ${HOME}
if [ -d .m2 ]; then
# all .m2 contents to tar stream
tar cf - .m2
fi
popd
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment