File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ cd $HOME
4+
5+ exec tar -xzf -
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ cd $HOME
4+
5+ # List the files and directories you would like to archive.
6+ #
7+ exec tar -czf - {bundle,gems}
Original file line number Diff line number Diff line change @@ -11,11 +11,22 @@ source ${HOME}/etc/helpers
1111# If the /tmp/src is empty, then print usage and exit.
1212(dir_is_empty /tmp/src) && print_usage_and_exit
1313
14+ # Detect the presence of $stdin and restore the artifacts
15+ # To restore the artifacts, you have to run the builder as:
16+ #
17+ # docker run -v $(pwd):/tmp/src openshift/centos-ruby-builder < artifacts.tgz
18+ #
19+ if [ -p /dev/stdin ]; then
20+ echo " ---> Restoring artifacts"
21+ cat | ${HOME} /bin/restore-artifacts
22+ fi
23+
1424# Build the ruby application first
1525#
1626${HOME} /bin/prepare
1727
1828# Replace this script with the application runner at the end of the build.
1929#
20- echo " ---> Build successful. Commit this image with: docker commit ${HOSTNAME} ruby-app"
30+ echo " ---> Build successful. Commit this image with: 'docker commit ${HOSTNAME} ruby-app'"
31+
2132cp -f ${HOME} /bin/run ${HOME} /bin/start && exit
Original file line number Diff line number Diff line change 33
44function print_usage_and_exit() {
55 echo
6- echo "This image can build your Ruby source code ."
7- echo "To build from a git repo, run this in your checked out repo :"
6+ echo "This is the Ruby/Rails self-contained builder image ."
7+ echo "You can use this to produce application images :"
88 echo
9- echo " docker run -v \$(pwd):/tmp/src openshift/centos-ruby-builder"
9+ echo " $ docker run -v \$(pwd):/tmp/src openshift/centos-ruby-builder"
1010 echo
11- echo "Options:"
11+ echo "You can also archive artifacts from the current application image:"
12+ echo
13+ echo " $ docker run --entrypoint='${HOME}/bin/save-artifacts' ruby-app > archive.tgz"
14+ echo
15+ echo "And restore the artifacts on the next build:"
16+ echo
17+ echo " $ docker run -v \$(pwd):/tmp/src openshift/centos-ruby-builder < archive.tgz"
18+ echo
19+ echo "Other options:"
1220 echo
1321 echo " --debug Drop to the shell instead of build."
1422 echo
15- exit
23+ exit 0
1624}
You can’t perform that action at this time.
0 commit comments