mirror of
https://github.com/tektoncd/catalog.git
synced 2024-12-17 08:26:33 +00:00
Port buildpacks to v1beta1 🦇
Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This commit is contained in:
parent
62be238965
commit
708c078c5e
@ -55,7 +55,7 @@ kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/build
|
||||
This `TaskRun` will use the `buildpacks-v3` task to fetch source code from a Git repo, build the source code, then publish a container image.
|
||||
|
||||
```
|
||||
apiVersion: tekton.dev/v1alpha1
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: TaskRun
|
||||
metadata:
|
||||
name: example-run
|
||||
@ -68,14 +68,6 @@ spec:
|
||||
# - name: my-cache
|
||||
# persistentVolumeClaim:
|
||||
# claimName: task-pv-claim
|
||||
inputs:
|
||||
resources:
|
||||
- name: source
|
||||
resourceSpec:
|
||||
type: git
|
||||
params:
|
||||
- name: url
|
||||
value: <your git repo, e.g. "https://github.com/buildpacks/samples">
|
||||
params:
|
||||
- name: SOURCE_SUBPATH
|
||||
value: <optional subpath within your source repo, e.g. "apps/java-maven">
|
||||
@ -84,8 +76,15 @@ spec:
|
||||
# Uncomment the lines below to use an existing cache
|
||||
# - name: CACHE
|
||||
# value: my-cache
|
||||
outputs:
|
||||
resources:
|
||||
inputs:
|
||||
- name: source
|
||||
resourceSpec:
|
||||
type: git
|
||||
params:
|
||||
- name: url
|
||||
value: <your git repo, e.g. "https://github.com/buildpacks/samples">
|
||||
outputs:
|
||||
- name: image
|
||||
resourceSpec:
|
||||
type: image
|
||||
|
@ -1,10 +1,9 @@
|
||||
---
|
||||
apiVersion: tekton.dev/v1alpha1
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: buildpacks-v3
|
||||
spec:
|
||||
inputs:
|
||||
params:
|
||||
- name: BUILDER_IMAGE
|
||||
description: The image on which builds will run (must include v3 lifecycle and compatible buildpacks).
|
||||
@ -25,11 +24,10 @@ spec:
|
||||
default: ""
|
||||
|
||||
resources:
|
||||
inputs:
|
||||
- name: source
|
||||
type: git
|
||||
|
||||
outputs:
|
||||
resources:
|
||||
- name: image
|
||||
type: image
|
||||
|
||||
@ -46,24 +44,24 @@ spec:
|
||||
args:
|
||||
- "-c"
|
||||
- >
|
||||
chown -R "$(inputs.params.USER_ID):$(inputs.params.GROUP_ID)" "/tekton/home" &&
|
||||
chown -R "$(inputs.params.USER_ID):$(inputs.params.GROUP_ID)" "/layers" &&
|
||||
chown -R "$(inputs.params.USER_ID):$(inputs.params.GROUP_ID)" "/cache" &&
|
||||
chown -R "$(inputs.params.USER_ID):$(inputs.params.GROUP_ID)" "/workspace/source"
|
||||
chown -R "$(params.USER_ID):$(params.GROUP_ID)" "/tekton/home" &&
|
||||
chown -R "$(params.USER_ID):$(params.GROUP_ID)" "/layers" &&
|
||||
chown -R "$(params.USER_ID):$(params.GROUP_ID)" "/cache" &&
|
||||
chown -R "$(params.USER_ID):$(params.GROUP_ID)" "/workspace/source"
|
||||
volumeMounts:
|
||||
- name: layers-dir
|
||||
mountPath: /layers
|
||||
- name: $(inputs.params.CACHE)
|
||||
- name: $(params.CACHE)
|
||||
mountPath: /cache
|
||||
securityContext:
|
||||
privileged: true
|
||||
|
||||
- name: detect
|
||||
image: $(inputs.params.BUILDER_IMAGE)
|
||||
image: $(params.BUILDER_IMAGE)
|
||||
imagePullPolicy: Always
|
||||
command: ["/cnb/lifecycle/detector"]
|
||||
args:
|
||||
- "-app=/workspace/source/$(inputs.params.SOURCE_SUBPATH)"
|
||||
- "-app=/workspace/source/$(params.SOURCE_SUBPATH)"
|
||||
- "-group=/layers/group.toml"
|
||||
- "-plan=/layers/plan.toml"
|
||||
volumeMounts:
|
||||
@ -71,23 +69,23 @@ spec:
|
||||
mountPath: /layers
|
||||
|
||||
- name: analyze
|
||||
image: $(inputs.params.BUILDER_IMAGE)
|
||||
image: $(params.BUILDER_IMAGE)
|
||||
imagePullPolicy: Always
|
||||
command: ["/cnb/lifecycle/analyzer"]
|
||||
args:
|
||||
- "-layers=/layers"
|
||||
- "-helpers=$(inputs.params.USE_CRED_HELPERS)"
|
||||
- "-helpers=$(params.USE_CRED_HELPERS)"
|
||||
- "-group=/layers/group.toml"
|
||||
- "-cache-dir=/cache"
|
||||
- "$(outputs.resources.image.url)"
|
||||
- "$(resources.outputs.image.url)"
|
||||
volumeMounts:
|
||||
- name: $(inputs.params.CACHE)
|
||||
- name: $(params.CACHE)
|
||||
mountPath: /cache
|
||||
- name: layers-dir
|
||||
mountPath: /layers
|
||||
|
||||
- name: restore
|
||||
image: $(inputs.params.BUILDER_IMAGE)
|
||||
image: $(params.BUILDER_IMAGE)
|
||||
imagePullPolicy: Always
|
||||
command: ["/cnb/lifecycle/restorer"]
|
||||
args:
|
||||
@ -95,17 +93,17 @@ spec:
|
||||
- "-layers=/layers"
|
||||
- "-cache-dir=/cache"
|
||||
volumeMounts:
|
||||
- name: $(inputs.params.CACHE)
|
||||
- name: $(params.CACHE)
|
||||
mountPath: /cache
|
||||
- name: layers-dir
|
||||
mountPath: /layers
|
||||
|
||||
- name: build
|
||||
image: $(inputs.params.BUILDER_IMAGE)
|
||||
image: $(params.BUILDER_IMAGE)
|
||||
imagePullPolicy: Always
|
||||
command: ["/cnb/lifecycle/builder"]
|
||||
args:
|
||||
- "-app=/workspace/source/$(inputs.params.SOURCE_SUBPATH)"
|
||||
- "-app=/workspace/source/$(params.SOURCE_SUBPATH)"
|
||||
- "-layers=/layers"
|
||||
- "-group=/layers/group.toml"
|
||||
- "-plan=/layers/plan.toml"
|
||||
@ -114,20 +112,20 @@ spec:
|
||||
mountPath: /layers
|
||||
|
||||
- name: export
|
||||
image: $(inputs.params.BUILDER_IMAGE)
|
||||
image: $(params.BUILDER_IMAGE)
|
||||
imagePullPolicy: Always
|
||||
command: ["/cnb/lifecycle/exporter"]
|
||||
args:
|
||||
- "-app=/workspace/source/$(inputs.params.SOURCE_SUBPATH)"
|
||||
- "-app=/workspace/source/$(params.SOURCE_SUBPATH)"
|
||||
- "-layers=/layers"
|
||||
- "-helpers=$(inputs.params.USE_CRED_HELPERS)"
|
||||
- "-helpers=$(params.USE_CRED_HELPERS)"
|
||||
- "-group=/layers/group.toml"
|
||||
- "-cache-dir=/cache"
|
||||
- "$(outputs.resources.image.url)"
|
||||
- "$(resources.outputs.image.url)"
|
||||
volumeMounts:
|
||||
- name: layers-dir
|
||||
mountPath: /layers
|
||||
- name: $(inputs.params.CACHE)
|
||||
- name: $(params.CACHE)
|
||||
mountPath: /cache
|
||||
|
||||
volumes:
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
apiVersion: tekton.dev/v1alpha1
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: TaskRun
|
||||
metadata:
|
||||
name: buildpacks-run
|
||||
@ -11,11 +11,6 @@ spec:
|
||||
- name: buildpacks-cache
|
||||
persistentVolumeClaim:
|
||||
claimName: buildpacks-cache-pvc
|
||||
inputs:
|
||||
resources:
|
||||
- name: source
|
||||
resourceRef:
|
||||
name: buildpacks-samples
|
||||
params:
|
||||
- name: SOURCE_SUBPATH
|
||||
value: apps/java-maven
|
||||
@ -23,8 +18,12 @@ spec:
|
||||
value: cnbs/sample-builder:alpine-p0.2
|
||||
- name: CACHE
|
||||
value: buildpacks-cache
|
||||
outputs:
|
||||
resources:
|
||||
inputs:
|
||||
- name: source
|
||||
resourceRef:
|
||||
name: buildpacks-samples
|
||||
outputs:
|
||||
- name: image
|
||||
resourceRef:
|
||||
name: buildpacks-app-image
|
Loading…
Reference in New Issue
Block a user