blob: 00e2a76a13b3e88edad4d6796822e5042fc03f39 [file] [log] [blame]
#!/bin/bash
# Builds and uploads debian packages for various ingestion services.
set -x -e
ALL_IDS="skia pdfium chromevr"
print_usage() {
echo "Usage: $0 MESSAGE INSTANCE_ID"
echo " MESSAGE is the message to be included in the release package."
echo " INSTANCE_ID is the id of the instance targeted by this package."
echo " This should be one of: '$ALL_IDS' or 'all'."
exit 1
}
if [ "$#" -ne 2 ]; then
print_usage
fi
TARGET_INSTANCE_IDS=$2
# Strip the second argument to keep this compatible with the shared build script.
set -- "$1"
# Determine the instance ids we want to build
if [ "$TARGET_INSTANCE_IDS" = "all" ]; then
TARGET_INSTANCE_IDS=$ALL_IDS
fi
for INSTANCE_ID in $TARGET_INSTANCE_IDS; do
APPNAME="${INSTANCE_ID}-gold-ingestion"
SYSTEMD="${APPNAME}.service"
SERVICE_FILE="./sys/${SYSTEMD}"
DESCRIPTION="Ingest test results."
# Copy files into the right locations in ${ROOT}.
copy_release_files()
{
INSTALL="fakeroot install -D --verbose --backup=none --group=root --owner=root"
INSTALL_DIR="fakeroot install -d --verbose --backup=none --group=root --owner=root"
${INSTALL_DIR} --mode=777 ${ROOT}/mnt/pd0/${APPNAME}/repo
${INSTALL} --mode=644 -T ${SERVICE_FILE} ${ROOT}/etc/systemd/system/${SYSTEMD}
${INSTALL} --mode=755 -T ${GOPATH}/bin/gold_ingestion ${ROOT}/usr/local/bin/${APPNAME}
${INSTALL} --mode=644 -T ./sys/${APPNAME}.json5 ${ROOT}/etc/${APPNAME}/config.json5
}
source ../bash/release.sh
done