view filesender.xml @ 1:17787c79af44 draft

planemo upload for repository https://github.com/usegalaxy-au/tools-au/tree/master/tools/aarnetfilesender commit 58b769b77b30bb5739e07441a77ea6ca572647d9
author galaxy-australia
date Mon, 07 Oct 2024 04:49:30 +0000
parents 7f6de5d9fb50
children
line wrap: on
line source

<tool id="aarnet_filesender" name="AARNet FileSender" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>transfer files to AARNet's FileSender Service</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="version_command"/>
    <command detect_errors="exit_code"><![CDATA[
#if $test != "":
    filesender -h &&
    exit 0;
#end if

#set $apiuser = $__user__.extra_preferences.get('aarnet_filesender_account|username', "").strip()
#set $apikey = $__user__.extra_preferences.get('aarnet_filesender_account|apikey', "").strip()

#if $apiuser == "" or $apikey == "":
    echo "ERROR: Please enter your FileSender Username in your user preferences under the AARNet FileSender Account Info section" >&2 &&
    exit 1;
#end if

#if $to == "":
    echo "WARNING: recipent email not set, setting to $__user_email__" &&
    #set $to = $__user_email__
#end if

mkdir filestosend &&

#for $file in $data
    if [ -f "filestosend/${file.element_identifier}" ]; then
        echo "ERROR: two datasets have the same name (${file.element_identifier})" &&
        exit 1;
    fi &&
    ln -s "$file" "filestosend/${file.element_identifier}" &&
#end for

filesender -p -u '$apiuser' -a '$apikey' -b https://filesender.aarnet.edu.au/rest.php -f "galaxy-no-reply@usegalaxy.org.au" -r '$to' filestosend >$output 2>&1
    ]]></command>
    <inputs>
        <param name="data" type="data" format="txt,data" multiple="true" optional="false" label="Datasets to be sent:"/>
        <param name="to" type="text" optional="true" label="Email address of recipent:">
            <sanitizer sanitize="False"/>
        </param>
        <param name="test" type="hidden" value=""/>
    </inputs>
    <outputs>
        <data name="output" format="txt" hidden="false"/>
    </outputs>
    <tests>
        <test expect_exit_code="1" expect_failure="true">
            <param name="data" value="summary_statistics.txt"/>
            <assert_stderr>
                <has_text text="ERROR: Please enter your FileSender Username in your user preferences under the AARNet FileSender Account Info section"/>
            </assert_stderr>
        </test>
        <test>
            <param name="data" value="summary_statistics.txt"/>
            <param name="test" value="true"/>
            <assert_stdout>
                <has_text text="File Sender CLI client"/>
            </assert_stdout>
        </test>
    </tests>
    <help>
**What it does**
        Send dataset(s) from Galaxy to anyone via AARNet's FileSender service.

**Remarks**
        This tool leverages AARNet's FileSender (https://filesender.aarnet.edu.au)
        to send files out of Galaxy.
    </help>
    <citations>
        <citation type="bibtex">
           @misc{FileSenderCLI_github,
           title={FileSenderCLI Github page},
           url = {https://github.com/madsi1m/FileSenderCLI},}
        </citation>
    </citations>
</tool>