From f209398d93689cf29b0695b615478d63fee3eb37 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 5 Jun 2018 19:44:51 +0200 Subject: push to the new endpoint now --- mix.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'mix.sh') diff --git a/mix.sh b/mix.sh index 9df81a7..bc5eff5 100755 --- a/mix.sh +++ b/mix.sh @@ -1,12 +1,13 @@ #!/bin/bash if [ "$#" -ne 2 ]; then - echo "Usage: $0 render_name" + echo "Usage: $0 render_name endpoint" exit fi dir=$1 name=$2 +endpoint=$3 now=`date +'%Y%m%d'` echo "rendering $name" @@ -21,5 +22,16 @@ cd .. grep valid log cd ../.. -node upload.js "./output/$name.mp3" - +if [ -z "$endpoint" ]; then + echo "no endpoint specified, upload to bucky"; + node upload.js "./output/$name.mp3" +else + echo "upload to $endpoint" + curl \ + -X PUT \ + -F "module=samplernn" \ + -F "activity=train" \ + -F "generated=true" \ + -F "file=@./output/$name.mp3" \ + $endpoint +fi -- cgit v1.2.3-70-g09d2