blob: b4769259c1f30433345eb3b57666177db44f8581 [file] [log] [blame]
#!/bin/bash
set -x -e
# Packages the skia_diff_server.
ALL_IDS="prod stage"
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=diffserver-$INSTANCE_ID
SERVICE_FILE="./sys/${APPNAME}.service"
if [ ! -f ${SERVICE_FILE} ]; then
exit 1
fi
# Builds and uploads a debian package for skiacorrectness.
SYSTEMD="${APPNAME}.service"
DESCRIPTION="Image diffs and processing server."
DEPENDS=git
# Copy files into the right locations in ${ROOT}.
copy_release_files()
{
set -e
INSTALL="sudo install -D --verbose --backup=none --group=root --owner=root"
INSTALL_DIR="sudo install -d --verbose --backup=none --group=root --owner=root"
${INSTALL} --mode=755 -T ${GOPATH}/bin/skia_diff_server ${ROOT}/usr/local/bin/${APPNAME}
${INSTALL} --mode=644 -T $SERVICE_FILE ${ROOT}/etc/systemd/system/${APPNAME}.service
}
source ../bash/release.sh
done