File tree 4 files changed +37
-6
lines changed
4 files changed +37
-6
lines changed 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
11
11
# If the /tmp/src is empty, then print usage and exit.
12
12
(dir_is_empty /tmp/src) && print_usage_and_exit
13
13
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
+
14
24
# Build the ruby application first
15
25
#
16
26
${HOME} /bin/prepare
17
27
18
28
# Replace this script with the application runner at the end of the build.
19
29
#
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
+
21
32
cp -f ${HOME} /bin/run ${HOME} /bin/start && exit
Original file line number Diff line number Diff line change 3
3
4
4
function print_usage_and_exit() {
5
5
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 :"
8
8
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"
10
10
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:"
12
20
echo
13
21
echo " --debug Drop to the shell instead of build."
14
22
echo
15
- exit
23
+ exit 0
16
24
}
You can’t perform that action at this time.
0 commit comments