view build_upload_nightly @ 1242:73003ad27518

Use public key auth rather than trying to make passowrd auth work in a script
author Michael Pavone <pavone@retrodev.com>
date Sun, 26 Feb 2017 20:21:52 -0800
parents 23a2cf9782a7
children 50700d370a33
line wrap: on
line source

#!/bin/sh

name=$1
. "$HOME/$name.params"
echo Starting $CONTAINER_NAME
lxc-start -n "$CONTAINER_NAME"
if [ $? -ne 0 ]; then
	exit $?
fi
echo Starting build by $BUILD_USER in $CONTAINER_NAME
lxc-attach -n "$CONTAINER_NAME" -- /home/$BUILD_USER/blastem/build_nightly $BUILD_USER > /tmp/build_${name}_out.log
if [ $? -ne 0 ]; then
	lxc-stop -n "$CONTAINER_NAME"
	exit $?
fi
lxc-stop -n "$CONTAINER_NAME"
. $HOME/remote.params
artifact=$(tail -n 1 /tmp/build_${name}_out.log)
scp -i "$REMOTE_IDENT" "$HOME/.local/share/lxc/$CONTAINER_NAME/rootfs/home/$BUILD_USER/blastem/$artifact" $REMOTE_USER@$REMOTE_HOST:/home/$REMOTE_USER/nightlies