Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LINC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ResearchAndDevelopment
LINC
Commits
8c8a7c6a
Commit
8c8a7c6a
authored
4 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
Add log collecting utils
Former-commit-id:
628a1832
Former-commit-id:
a7c32fe9
parent
c7327884
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
steps/bulk_rename.cwl
+39
-0
39 additions, 0 deletions
steps/bulk_rename.cwl
steps/collectlog.cwl
+47
-0
47 additions, 0 deletions
steps/collectlog.cwl
with
86 additions
and
0 deletions
steps/bulk_rename.cwl
0 → 100644
+
39
−
0
View file @
8c8a7c6a
class: CommandLineTool
cwlVersion: v1.0
$namespaces:
sbg: 'https://www.sevenbridges.com/'
id: bulk_rename
baseCommand:
- bash
- bulk_rename.sh
inputs:
- id: file_list
type: 'File[]'
inputBinding:
position: 0
- id: file_prefix
type: string
- id: file_suffix
type: string?
outputs:
- id: output
type: 'File[]'
outputBinding:
glob: "tmp/$(inputs.file_prefix)*"
label: bulk_rename
requirements:
- class: InitialWorkDirRequirement
listing:
- entryname: bulk_rename.sh
entry: |
#!/bin/bash
set -e
FILE_LIST=("\${@}")
FILE_PREFIX=$(inputs.file_prefix)
FILE_SUFFIX=$(inputs.file_suffix === null ? '' : inputs.file_suffix)
mkdir tmp
for i in "\${!FILE_LIST[@]}"; do
cp "\${FILE_LIST[\$i]}" "tmp/\${FILE_PREFIX}_\${i}\${FILE_SUFFIX}"
done
writable: false
- class: InlineJavascriptRequirement
This diff is collapsed.
Click to expand it.
steps/collectlog.cwl
0 → 100644
+
47
−
0
View file @
8c8a7c6a
class: CommandLineTool
cwlVersion: v1.0
$namespaces:
sbg: 'https://www.sevenbridges.com/'
id: collectlog
baseCommand:
- bash
- collect_logs.sh
inputs:
- id: start_directory
type: Directory?
- id: log_files
type:
- File
- type: array
items: File
inputBinding:
position: 0
- id: sub_directory_name
type: string
outputs:
- id: log_dir
type: Directory
outputBinding:
glob: |
$(inputs.start_directory === null ? inputs.sub_directory_name: inputs.start_directory.basename)
label: CollectLog
requirements:
- class: InitialWorkDirRequirement
listing:
- entryname: collect_logs.sh
entry: |
#!/bin/bash
set -e
BASE_DIR="$(inputs.start_directory === null ? "" : inputs.start_directory.basename)"
SUB_DIR="$(inputs.sub_directory_name)"
if [ -z "$BASE_DIR" ]
then
OUTPUT_PATH=$SUB_DIR
else
OUTPUT_PATH=$BASE_DIR/$SUB_DIR
fi
echo $OUTPUT_PATH
mkdir -p $OUTPUT_PATH
cp -L $* $OUTPUT_PATH
writable: false
- class: InlineJavascriptRequirement
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment