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 #!/bin/bash
#
# Default STI assemble script for the 'springboot-maven3-centos' image.
#
if [ "$1" = "-h" ]; then set -e
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"
echo "---> Installing application source" echo "---> Installing application source"
mkdir -p ${APP_RUNTIME_DIR} cp -Rf /tmp/src/. ./
cp -Rf ${APP_SRC_DIR}/* ${APP_RUNTIME_DIR}/
pushd "$APP_RUNTIME_DIR/${APP_ROOT}" >/dev/null
echo "---> Building Spring Boot application from source" echo "---> Building Spring Boot application from source"
mvn clean install mvn clean install
popd >/dev/null # Fix source directory permissions
fix-permissions ./
#!/bin/bash -e #!/bin/bash
cd $APP_ROOT_DIR set -e
# 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
echo "---> Starting Spring Boot application" echo "---> Starting Spring Boot application"
java -jar `find target -name *.jar` 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 @@ ...@@ -3,8 +3,12 @@
cat <<EOF cat <<EOF
This is a STI springboot maven3 centos base image: This is a STI springboot maven3 centos base image:
To use it, install STI: https://github.com/openshift/source-to-image To use it, install STI: https://github.com/openshift/source-to-image
Sample invocation: Sample invocation:
sti build git://github.com/codecentric/spring-boot-sample codecentric/springboot-maven3-centos springboot-app sti build git://github.com/codecentric/spring-boot-sample codecentric/springboot-maven3-centos springboot-app
You can then run the resulting image via: You can then run the resulting image via:
docker run -p 8080:8080 sinatra-app docker run -p 8080:8080 springboot-app
EOF 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