blob: 01b50a2a616e2b2296ae1af7c48fd34f4d1b8d92 [file] [log] [blame]
#!/bin/sh
set -eu
USERDIR="$1"
BUILDNAME="$2"
. check-config.sh
. "${USERDIR}/config"
# Produce commands that gather and send the results
echo ''
echo '# Create result artifact and upload'
echo 'if [ -d "${WORKSPACE}/result" ]; then'
echo ' cd "${WORKSPACE}/result"'
# TODO: We could be fancier and stream directly to the destination instead of
# creating a .tar.gz intermediate file...
echo ' shopt -s dotglob nullglob'
echo ' tar -c --gzip -f ../result.tar.gz *'
echo " curl -s -S -f -X POST -F file=@\"\${WORKSPACE}/result.tar.gz\" '${SUBMIT_RESULTS_URL}/${BUILDNAME}.tar.gz'"
echo 'fi'