--- /dev/null
+Send build jobs to a remote server
+
+This is just a wrapper around SSH to send easily send builds to a remote server
+and receive back a binary. Intended for single user usage, and no security
+features are built in.
--- /dev/null
+#!/usr/bin/sh -e
+
+usage() {
+ echo 'Usage: kiss send-build [command] [options]
+build KISS packages on a remote server
+
+Options:
+ -h, --help show this help message
+
+Subcommands:
+ build [package] initiate a remote build
+ status get current remote status
+ get [package] receive a built package
+
+Configuration:
+ Done via environment variables
+
+ $KISS_SERV_HOST remote host to connect to
+ (defaults to localhost)
+ $KISS_SERV_USER remote host to connect to
+ (defaults to $(whoami))
+ $KISS_SERV_PORT remote port to connect to
+ (defaults to 22)'
+}
+
+parse_err() {
+ echo "$1"
+ $2
+ exit 2
+}
+
+sshexec() {
+ $sshcmd kiss serv $1 $2
+ exit
+}
+
+get() {
+ contents=$sshcmd 'ls -1 ~/.cache/kiss/bin/'
+ pkg=$(echo $contents | sort | grep -m 1 "$2")
+ rsync -azre "ssh -p $sshcmd" "$user"@"$host":/home/"$user"/.cache/kiss/bin/"$pkg" \
+ ~/.cache/kiss/bin
+}
+
+port=${KISS_SERV_PORT:-22}
+host=${KISS_SERV_HOST:-localhost}
+user=${KISS_SERV_USER:-$(whoami)}
+sshcmd="ssh -p $port $user@$host"
+
+while [ "$1" != "" ]; do
+ case $1 in
+ -h | --help)
+ usage
+ exit
+ ;;
+ build)
+ build "$@"
+ ;;
+ status | get)
+ sshexec "$@"
+ ;;
+ get)
+ get "$@"
+ ;;
+ *)
+ parse_err "ERROR: unknown option $1 \n" usage
+ ;;
+ esac
+ shift 2
+done
+parse_err "ERROR: no command given\n" usage
--- /dev/null
+#!/usr/bin/sh -e
+
+usage() {
+ echo "for use with kiss send-build"
+}
+
+parse_err() {
+ echo "$1"
+ $2
+ exit 2
+}
+
+build() {
+ kiss build $2
+}
+
+status() {
+ echo "built packages:"
+ ls -1 ~/.cache/kiss/bin
+ echo "running kiss proceses:"
+ pgrep -a kiss
+}
+
+sshcmd="ssh -p ${KISS_SERV_PORT:-22} ${KISS_SERV_HOST:-localhost}"
+while [ "$1" != "" ]; do
+ case $1 in
+ -h | --help)
+ usage
+ exit
+ ;;
+ build | status)
+ "$1" "$@"
+ ;;
+ *)
+ parse_err "ERROR: unknown option $1 \n" usage
+ ;;
+ esac
+ shift 2
+done