blob: 2a9b935ef67c0a833d7b7beeeafdfaa9907f67af [file] [log] [blame]
#!/bin/bash
# Builds and uploads a debian package for CT frontend.
APPNAME=ctfe
set -x -e
# Copy files into the right locations in ${ROOT}.
copy_release_files()
{
INSTALL="install -D --verbose --backup=none"
INSTALL_DIR="install -d --verbose --backup=none"
# Copy over the Dockerfile.
${INSTALL} --mode=644 -T ${APPNAME}/Dockerfile ${ROOT}/Dockerfile
# Copy over the ctfe binary.
${INSTALL} --mode=755 -T ${GOPATH}/bin/ctfe ${ROOT}/usr/local/bin/${APPNAME}
# Copy over all frontend artifacts.
${INSTALL_DIR} --mode=755 ${ROOT}/usr/local/share/${APPNAME}/dist
${INSTALL} --mode=644 ./dist/* ${ROOT}/usr/local/share/${APPNAME}/dist
${INSTALL_DIR} --mode=755 ${ROOT}/usr/local/share/${APPNAME}/templates
${INSTALL} --mode=644 ./templates/* ${ROOT}/usr/local/share/${APPNAME}/templates
${INSTALL_DIR} --mode=755 ${ROOT}/usr/local/share/${APPNAME}/res/css
${INSTALL} --mode=644 -T ./res/css/ctfe.css ${ROOT}/usr/local/share/${APPNAME}/res/css/ctfe.css
${INSTALL_DIR} --mode=755 ${ROOT}/usr/local/share/${APPNAME}/res/img
${INSTALL} --mode=644 -T ./res/img/favicon.ico ${ROOT}/usr/local/share/${APPNAME}/res/img/favicon.ico
${INSTALL_DIR} --mode=755 ${ROOT}/usr/local/share/${APPNAME}/res/js
${INSTALL} --mode=644 -T ./res/js/core.js ${ROOT}/usr/local/share/${APPNAME}/res/js/core.js
${INSTALL_DIR} --mode=755 ${ROOT}/usr/local/share/${APPNAME}/res/vul
${INSTALL} --mode=644 -T ./res/vul/elements.html ${ROOT}/usr/local/share/${APPNAME}/res/vul/elements.html
# 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
# Copy over the windows executables.
${INSTALL} --mode=755 -T ${GOPATH}/bin/build_repo.exe ${ROOT}/usr/local/bin/build_repo.exe
${INSTALL} --mode=755 -T ${GOPATH}/bin/isolate_telemetry.exe ${ROOT}/usr/local/bin/isolate_telemetry.exe
${INSTALL} --mode=755 -T ${GOPATH}/bin/run_chromium_analysis.exe ${ROOT}/usr/local/bin/run_chromium_analysis.exe
${INSTALL} --mode=755 -T ${GOPATH}/bin/run_chromium_perf.exe ${ROOT}/usr/local/bin/run_chromium_perf.exe
}
source ../bash/docker_build.sh