diff macros.xml @ 0:2c43bac3579f draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tools/pgtools commit ab93c4c70fa487e55a24863a7786e102e7d92272
author bgruening
date Wed, 24 Apr 2019 06:11:25 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml	Wed Apr 24 06:11:25 2019 -0400
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<macros>
+    <xml name="inputs_outputs">
+        <inputs>
+            <param format="tabular" help="" label="Input tabular dataset" name="in_file" type="data" />
+            <yield />
+        </inputs>
+        <outputs>
+            <data format="tabular" name="out_file" label="${tool.name} on ${on_string}" />
+        </outputs>
+    </xml>
+
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="@PG_VERSION@">postgresql</requirement>
+            <requirement type="package" version="0.1">pglite</requirement>
+        </requirements>
+    </xml>
+
+    <token name="@PG_VERSION@">11.2</token>
+
+    <token name="@HELP_FOOTER@">
+    The postgresql tools, are using a postgresql database in user-space. Databases are packed into a tarball and stored in the user-history.
+    </token>
+
+    <token name="@UNTAR_INFILE@"><![CDATA[
+        tar -xjvf '$infile' &&
+        export PWD=`pwd` &&
+        sed -i.bak "s|unix_socket_directories.*|unix_socket_directories = '\$PWD/postgresql/'|" ./postgresql/db/postgresql.conf
+    ]]>
+    </token>
+
+    <token name="@PG_SETUP@"><![CDATA[
+        pglite setup -d ./postgresql &&
+        @PG_START@
+    ]]>
+    </token>
+
+    <token name="@PSQL@"><![CDATA[
+        psql "\$(pglite url -d ./postgresql)"
+    ]]>
+    </token>
+
+    <token name="@STATUS_RUNNING@"><![CDATA[
+        timeout 60 bash -c 'until pglite status -d ./postgresql | grep -F -q "server is running"; do sleep 1; done' &&
+        pglite status -d ./postgresql &&
+        timeout 60 bash -c 'until ls -la ./postgresql | grep -F -q ".s.PGSQL.5432"; do sleep 1; done'
+        && pglite status -d ./postgresql 
+    ]]>
+    </token>
+
+    <token name="@STOPPED@"><![CDATA[
+        timeout 60 bash -c 'until pglite status -d ./postgresql | grep -F -q "no server running"; do sleep 1; done'
+    ]]>
+    </token>
+
+    <token name="@PG_START@"><![CDATA[
+        pglite start  -d ./postgresql &&
+        @STATUS_RUNNING@
+    ]]>
+    </token>
+
+    <token name="@PG_STOP@"><![CDATA[
+        pglite stop -d ./postgresql &&
+        @STOPPED@
+    ]]>
+    </token>
+
+    <token name="@ARCHIVE_DATABASE@"><![CDATA[
+        tar -cvjf postgresql_out.tar.bz2 postgresql
+    ]]>
+    </token>
+    <xml name="citations">
+        <citations></citations>
+    </xml>
+</macros>