Skip to content

Instantly share code, notes, and snippets.

@lance
Last active July 18, 2019 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lance/4641d53e8928f5c8e0c20384bd5db6c9 to your computer and use it in GitHub Desktop.
Save lance/4641d53e8928f5c8e0c20384bd5db6c9 to your computer and use it in GitHub Desktop.
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: deploy-webapp
spec:
inputs:
resources:
- name: source
type: git
params:
- name: BUILDER_IMAGE
description: The location of the s2i builder image
- name: PATH_CONTEXT
description: The location of the build output
default: build
- name: TLSVERIFY
description: Verify the TLS on the registry endpoint
default: "true"
outputs:
resources:
- name: runtimeimage
type: image
steps:
- name: generate
image: quay.io/openshift-pipeline/s2i
workingdir: /workspace/source
command: ['s2i', 'build', '${inputs.params.PATH_CONTEXT}', '${inputs.params.BUILDER_IMAGE}', '--as-dockerfile', '/gen-source/Dockerfile.gen']
volumeMounts:
- name: gen-source
mountPath: /gen-source
- name: build
image: quay.io/buildah/stable
workingdir: /gen-source
command: ['buildah', 'bud', '--tls-verify=${inputs.params.TLSVERIFY}', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '${outputs.resources.runtimeimage.url}', '.']
volumeMounts:
- name: varlibcontainers
mountPath: /var/lib/containers
- name: gen-source
mountPath: /gen-source
securityContext:
privileged: true
- name: push
image: quay.io/buildah/stable
command: ['buildah', 'push', '--tls-verify=${inputs.params.TLSVERIFY}', '${outputs.resources.runtimeimage.url}', 'docker://${outputs.resources.runtimeimage.url}']
volumeMounts:
- name: varlibcontainers
mountPath: /var/lib/containers
securityContext:
privileged: true
volumes:
- name: varlibcontainers
emptyDir: {}
- name: gen-source
emptyDir: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment