mirror of
https://github.com/tektoncd/catalog.git
synced 2024-11-29 06:34:08 +00:00
91 lines
2.4 KiB
YAML
91 lines
2.4 KiB
YAML
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: s2i
|
|
labels:
|
|
app.kubernetes.io/version: "0.1"
|
|
annotations:
|
|
tekton.dev/pipelines.minVersion: "0.12.1"
|
|
tekton.dev/tags: image-build
|
|
spec:
|
|
description: >-
|
|
Source-to-Image (S2I) is a toolkit and workflow for building reproducible
|
|
container images from source code
|
|
|
|
S2I produces images by injecting source code into a base S2I container image
|
|
and letting the container prepare that source code for execution. The base
|
|
S2I container images contains the language runtime and build tools needed for
|
|
building and running the source code.
|
|
|
|
params:
|
|
- name: BUILDER_IMAGE
|
|
description: The location of the s2i builder image.
|
|
- name: PATH_CONTEXT
|
|
description: The location of the path to run s2i from.
|
|
default: .
|
|
- name: TLSVERIFY
|
|
description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry)
|
|
default: 'true'
|
|
- name: LOGLEVEL
|
|
description: Log level when running the S2I binary
|
|
default: '0'
|
|
resources:
|
|
outputs:
|
|
- name: image
|
|
type: image
|
|
workspaces:
|
|
- name: source
|
|
steps:
|
|
- name: generate
|
|
command:
|
|
- /usr/local/bin/s2i
|
|
- --loglevel=$(params.LOGLEVEL)
|
|
- build
|
|
- $(params.PATH_CONTEXT)
|
|
- $(params.BUILDER_IMAGE)
|
|
- --as-dockerfile
|
|
- /gen-source/Dockerfile.gen
|
|
image: quay.io/openshift-pipeline/s2i:nightly
|
|
volumeMounts:
|
|
- mountPath: /gen-source
|
|
name: gen-source
|
|
workingDir: $(workspaces.source.path)
|
|
- name: build
|
|
command:
|
|
- buildah
|
|
- bud
|
|
- --tls-verify=$(params.TLSVERIFY)
|
|
- --layers
|
|
- -f
|
|
- /gen-source/Dockerfile.gen
|
|
- -t
|
|
- $(resources.outputs.image.url)
|
|
- .
|
|
image: quay.io/buildah/stable:v1.17.0
|
|
securityContext:
|
|
privileged: true
|
|
volumeMounts:
|
|
- mountPath: /var/lib/containers
|
|
name: varlibcontainers
|
|
- mountPath: /gen-source
|
|
name: gen-source
|
|
workingDir: /gen-source
|
|
- name: push
|
|
command:
|
|
- buildah
|
|
- push
|
|
- --tls-verify=$(params.TLSVERIFY)
|
|
- $(resources.outputs.image.url)
|
|
- docker://$(resources.outputs.image.url)
|
|
image: quay.io/buildah/stable:v1.17.0
|
|
securityContext:
|
|
privileged: true
|
|
volumeMounts:
|
|
- mountPath: /var/lib/containers
|
|
name: varlibcontainers
|
|
volumes:
|
|
- emptyDir: {}
|
|
name: varlibcontainers
|
|
- emptyDir: {}
|
|
name: gen-source
|