You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
deltachat-desktop/deploy.sh

44 lines
1.1 KiB

#!/bin/sh
set -e
if [ $# -eq 0 ]; then
echo "No arguments provided. Aborting..."
exit 1
fi
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "usage: ./deploy.sh [-h] [DIST_DIR INCOMING_DIR READY_SUFFIX]
Deploys packages for you.
Possible values for the arguments:
DIST_DIR path of the binary package(s) to deploy
INCOMING_DIR remote path of the 'incoming' directory
READY_SUFFIX suffix used to flag a complete transfer of a file
Dependencies: openssh-client
"
exit 0
fi
if [ $# -lt 4 ]; then
echo "Mandatory arguments: 'DIST_DIR', 'INCOMING_DIR', 'INCOMING_DIR'. Aborting..."
exit 1
fi
DIST_DIR="${1}"
INCOMING_DIR="${2}"
READY_SUFFIX="${3}"
for ENTRY in "${DIST_DIR}"/*.deb; do
# If is not a file skip
if [ -f "${ENTRY}" ]; then
FILENAME=$(basename "${ENTRY}")
#scp "${ENTRY}" reposerver:"${INCOMING_DIR}/${FILENAME}"
#scp "${ENTRY}" reposerver:"${INCOMING_DIR}/${FILENAME}${READY_SUFFIX}"
cp "${ENTRY}" "${INCOMING_DIR}/${FILENAME}"
cp "${ENTRY}" "${INCOMING_DIR}/${FILENAME}${READY_SUFFIX}"
fi
done