#!/bin/bash
set -e -x

scp $1 media66.justin.tv:/tmp/
deb_file=$(basename $1)

ssh media66.justin.tv -t "sudo -u jtv -i sh -c 'aptly repo add -remove-files=false precise /tmp/$deb_file; aptly repo add -remove-files=false lucid /tmp/$deb_file; aptly publish update precise twitch; aptly publish update lucid twitch;'"