| #!/bin/bash |
| # Builds and uploads a debian package for ct_master. |
| APPNAME=ct-master |
| |
| set -x -e |
| |
| # Copy files into the right locations in ${ROOT}. |
| copy_release_files() |
| { |
| INSTALL="fakeroot install -D --verbose --backup=none" |
| INSTALL_DIR="fakeroot install -d --verbose --backup=none" |
| |
| # Copy over the Dockerfile. |
| ${INSTALL} --mode=644 -T ${APPNAME}/Dockerfile ${ROOT}/Dockerfile |
| |
| # Copy over the poller. |
| ${INSTALL} --mode=755 -T ${GOPATH}/bin/poller ${ROOT}/usr/local/bin/poller |
| |
| # Copy over the isolate files and python scripts. |
| ${INSTALL_DIR} --mode=755 ${ROOT}/usr/local/share/${APPNAME}/isolates |
| ${INSTALL} --mode=644 ./isolates/* ${ROOT}/usr/local/share/${APPNAME}/isolates |
| ${INSTALL_DIR} --mode=755 ${ROOT}/usr/local/share/${APPNAME}/py |
| ${INSTALL} --mode=644 ./py/*.py ${ROOT}/usr/local/share/${APPNAME}/py |
| ${INSTALL_DIR} --mode=755 ${ROOT}/usr/local/share/${APPNAME}/py/html-templates |
| ${INSTALL} --mode=644 ./py/html-templates/*.html ${ROOT}/usr/local/share/${APPNAME}/py/html-templates |
| |
| # Copy over all master scripts. |
| for master_script in ./go/master_scripts/*; do |
| master_script_name=$(basename "$master_script") |
| master_script_binary=${GOPATH}/bin/$master_script_name |
| if [ -e "$master_script_binary" ]; then |
| ${INSTALL} --mode=755 -T $master_script_binary ${ROOT}/usr/local/bin/$master_script_name |
| fi |
| done |
| |
| # Copy over all worker scripts. |
| for worker_script in ./go/worker_scripts/*; do |
| worker_script_name=$(basename "$worker_script") |
| worker_script_binary=${GOPATH}/bin/$worker_script_name |
| if [ -e "$worker_script_binary" ]; then |
| ${INSTALL} --mode=755 -T $worker_script_binary ${ROOT}/usr/local/bin/$worker_script_name |
| fi |
| done |
| } |
| |
| source ../bash/docker_build.sh |