-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wget source component for downloading scan results
- Loading branch information
1 parent
9a3ed87
commit 6df5170
Showing
3 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
subinclude( | ||
"///k8s//build/defs:k8s", | ||
"//build/defs:buildkit", | ||
"//build/defs:dracon", | ||
) | ||
|
||
dracon_component( | ||
name = "source-fetch_scan_results", | ||
images = [ | ||
"//third_party/docker/library/buildpack-dependencies/stable-curl", | ||
], | ||
task = "task.yaml", | ||
visibility = ["//examples/pipelines/..."], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# DO NOT EDIT. Code generated by: | ||
# github.com/ocurity/dracon//build/tools/kustomize-component-generator. | ||
|
||
apiVersion: kustomize.config.k8s.io/v1alpha1 | ||
kind: Component | ||
resources: | ||
- task.yaml | ||
patches: | ||
# Add the Task to the Tekton Pipeline. | ||
- patch: | | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Pipeline | ||
metadata: | ||
name: unused | ||
spec: | ||
workspaces: | ||
- name: source-code-ws | ||
tasks: | ||
- name: wget | ||
taskRef: | ||
name: wget | ||
workspaces: | ||
- name: source-code-ws | ||
workspace: source-code-ws | ||
params: | ||
- name: wget-url | ||
value: $(params.wget-url) | ||
- name: wget-options | ||
value: | ||
- $(params.wget-options) | ||
- name: wget-filename | ||
value: $(params.wget-filename) | ||
params: | ||
- name: wget-url | ||
description: The url we want to download file from | ||
type: string | ||
default: "" | ||
- name: wget-options | ||
description: The arguments to pass to wget | ||
type: array | ||
default: [] | ||
- name: wget-filename | ||
description: The filename we want to change our file to | ||
type: string | ||
default: "" | ||
target: | ||
kind: Pipeline | ||
# Add anchors to Task. | ||
- patch: | | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: wget | ||
labels: | ||
app.kubernetes.io/version: "0.6" | ||
v1.dracon.ocurity.com/component: source | ||
spec: | ||
params: | ||
- name: anchors | ||
type: array | ||
description: A list of tasks that this task depends on using their anchors. | ||
default: [] | ||
results: | ||
- name: anchor | ||
description: An anchor to allow other tasks to depend on this task. | ||
steps: | ||
- name: anchor | ||
image: docker.io/busybox:1.35.0 | ||
script: echo "$(context.task.name)" > "$(results.anchor.path)" | ||
target: | ||
kind: Task | ||
name: wget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
# https://hub.tekton.dev/tekton/task/wget | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: wget | ||
labels: | ||
v1.dracon.ocurity.com/component: source | ||
app.kubernetes.io/version: "0.6" | ||
annotations: | ||
tekton.dev/pipelines.minVersion: "0.29.0" | ||
tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" | ||
tekton.dev/tags: download | ||
|
||
spec: | ||
description: >- | ||
This source component is the dracon equivalent of the tekton wget component. | ||
workspaces: | ||
- name: source-code-ws | ||
description: The generated file will be stored onto the volume backing this Workspace. | ||
params: | ||
- name: wget-url | ||
description: The url we want to download file from | ||
type: string | ||
default: "" | ||
- name: wget-options | ||
description: The arguments to pass to wget | ||
type: array | ||
default: [] | ||
- name: wget-filename | ||
description: The filename we want to change our file to | ||
type: string | ||
default: "" | ||
steps: | ||
- name: wget | ||
image: "docker.io/library/buildpack-deps:stable-curl@sha256:3d5e59c47d5f82a769ad3f372cc9f86321e2e2905141bba974b75d3c08a53e8e" | ||
command: [wget] | ||
args: | ||
[ | ||
"$(params.wget-options[*])", | ||
"$(params.wget-url)", | ||
"$(workspaces.source-code-ws.path)/$(params.filename)", | ||
] |