#!/bin/bash # # Builds and deploys Zotero with full and incremental updates # set -euo pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="$(dirname "$SCRIPT_DIR")" . "$ROOT_DIR/config.sh" function usage { cat >&2 < "$TEMP_DIR/version_info/build-${os_name}.json" chmod g+w "$TEMP_DIR/version_info/build-${os_name}.json" done rsync -rv "$TEMP_DIR/version_info/" $DEPLOY_HOST:"$channel_deploy_path/$VERSION/" # Download updates JSON for each platform, update it, and reupload it for i in `seq 0 1 $((${#PLATFORMS}-1))` do case ${PLATFORMS:i:1} in m) architectures="mac" ;; w) architectures="win32 win-x64 win-arm64" ;; l) architectures="linux-i686 linux-x86_64 linux-arm64" ;; esac for arch in $architectures; do jsonfile="updates-$arch.json" scp $DEPLOY_HOST:"$channel_deploy_path/$jsonfile" "$TEMP_DIR/$jsonfile" "$SCRIPT_DIR/add_version_info" -f "$TEMP_DIR/$jsonfile" -v $VERSION -b $BUILD_ID scp "$TEMP_DIR/$jsonfile" $DEPLOY_HOST:"$channel_deploy_path/$jsonfile" done done # Add version to incremental lists echo for i in `seq 0 1 $((${#PLATFORMS}-1))` do "$SCRIPT_DIR/manage_incrementals" -c $CHANNEL -p ${PLATFORMS:i:1} -a $VERSION done $DEPLOY_CMD rm -rf "$STAGE_DIR"/*