Skip to content

Commit

Permalink
Components - Filesystem (#2659)
Browse files Browse the repository at this point in the history
* Components - Filesystem

* Get subdirectory
* Get file
* List items

* Fixed ls paramaters for Alpine
  • Loading branch information
Ark-kun authored and k8s-ci-robot committed Nov 27, 2019
1 parent aaf5785 commit 9e7e90b
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
20 changes: 20 additions & 0 deletions components/filesystem/get_file/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Get file
description: Get file from directory.
inputs:
- {name: Directory, type: Directory}
- {name: Subpath, type: String}
outputs:
- {name: File}
implementation:
container:
image: alpine
command:
- sh
- -ex
- -c
- |
mkdir -p "$(dirname "$2")"
cp -r "$0/$1" "$2"
- inputPath: Directory
- inputValue: Subpath
- outputPath: File
20 changes: 20 additions & 0 deletions components/filesystem/get_subdirectory/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Get subdirectory
description: Get subdirectory from directory.
inputs:
- {name: Directory, type: Directory}
- {name: Subpath, type: String}
outputs:
- {name: Subdir, type: Directory}
implementation:
container:
image: alpine
command:
- sh
- -ex
- -c
- |
mkdir -p "$(dirname "$2")"
cp -r "$0/$1" "$2"
- inputPath: Directory
- inputValue: Subpath
- outputPath: Subdir
19 changes: 19 additions & 0 deletions components/filesystem/list_items/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: List items
description: Recursively list directory contents.
inputs:
- {name: Directory, type: Directory}
outputs:
- {name: Items}
implementation:
container:
image: alpine
command:
- sh
- -ex
- -c
- |
mkdir -p "$(dirname "$1")"
#ls --almost-all --recursive "$0" > "$1"
ls -A -R "$0" > "$1"
- inputPath: Directory
- outputPath: Items

0 comments on commit 9e7e90b

Please sign in to comment.