github.com/openshift/source-to-image@v1.4.1-0.20240516041539-bf52fc02204e/examples/nginx-centos7/s2i/bin/assemble (about) 1 #!/bin/bash -e 2 # 3 # S2I assemble script for the 'nginx-centos7' image. 4 # The 'assemble' script builds your application source so that it is ready to run. 5 # 6 # For more information refer to the documentation: 7 # https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md 8 # 9 10 if [[ "$1" == "-h" ]]; then 11 # If the 'nginx-centos7' assemble script is executed with '-h' flag, 12 # print the usage. 13 exec /usr/libexec/s2i/usage 14 fi 15 16 # Restore artifacts from the previous build (if they exist). 17 # We set them here just for show, but you will need to set this up with your logic 18 # according to the application directory that you chose. 19 20 if [ "$(ls /tmp/artifacts/ 2>/dev/null)" ]; then 21 echo "---> Restoring build artifacts..." 22 mv /tmp/artifacts/* /etc/nginx 23 fi 24 25 # Override the default nginx index.html file. 26 # This is what we consider in this example 'installing the application' 27 # here you can go ahead an replace this with the actual building of python modules, 28 # bundle install, and anything else you need. 29 30 echo "---> Building and installing application from source..." 31 if [ -f /tmp/src/nginx.conf ]; then 32 mv /tmp/src/nginx.conf /etc/nginx/nginx.conf 33 fi 34 if [ "$(ls -A /tmp/src)" ]; then 35 mv /tmp/src/* /usr/share/nginx/html/ 36 fi