1#!/usr/bin/env cwl-runner
2### Generic Table (View/Materialized View) Initializer
3# Copyright (c) 2021. Harvard University
4#
5# Developed by Research Software Engineering,
6# Faculty of Arts and Sciences, Research Computing (FAS RC)
7# Author: Michael A Bouzinier
8#
9# Licensed under the Apache License, Version 2.0 (the "License");
10# you may not use this file except in compliance with the License.
11# You may obtain a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS,
17# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18# See the License for the specific language governing permissions and
19# limitations under the License.
20#
21
22cwlVersion: v1.2
23class: CommandLineTool
24baseCommand: [python, -m, dorieh.platform.loader.data_loader]
25requirements:
26 InlineJavascriptRequirement: {}
27 NetworkAccess:
28 networkAccess: True
29
30doc: |
31 This tool drops the tables and deletes all previous data from the database
32
33
34inputs:
35 registry:
36 type: File?
37 inputBinding:
38 prefix: --registry
39 doc: |
40 A path to the data model file
41 domain:
42 type: string
43 doc: the name of the domain
44 inputBinding:
45 prefix: --domain
46 table:
47 type: string?
48 inputBinding:
49 prefix: --table
50 default: ps
51 doc: the name of the table being deleted
52 database:
53 type: File
54 doc: Path to database connection file, usually database.ini
55 inputBinding:
56 prefix: --db
57 connection_name:
58 type: string
59 doc: The name of the section in the database.ini file
60 inputBinding:
61 prefix: --connection
62
63arguments:
64 - valueFrom: "--reset"
65
66
67outputs:
68 log:
69 type: File
70 outputBinding:
71 glob: "*.log"
72 errors:
73 type: stderr
74
75stderr: $("reset-" + inputs.table + ".err")