Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
Add a builder for applications
Browse files Browse the repository at this point in the history
Applications are built using the Cloud Foundery CNB builder,
cloudfoundry/cnb:bionic.
  • Loading branch information
scothis committed Apr 22, 2019
1 parent 600b087 commit 5760af1
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions cf-cnb-clusterbuildtemplate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
apiVersion: build.knative.dev/v1alpha1
kind: ClusterBuildTemplate
metadata:
name: cf-cnb
spec:
parameters:
- name: IMAGE
description: The image you wish to create. For example, "repo/example", or "example.com/repo/image".
- name: RUN_IMAGE
description: The run image buildpacks will use as the base for IMAGE.
default: packs/run:0.1.0
- name: BUILDER_IMAGE
description: The builder image provides the buildpacks that will build the IMAGE from source.
default: cloudfoundry/cnb:bionic
- name: USE_CRED_HELPERS
description: Use Docker credential helpers for Google's GCR, Amazon's ECR, or Microsoft's ACR.
default: 'true'
- name: USER_ID
description: The user ID of the builder image user
default: "1000"
- name: GROUP_ID
description: The group ID of the builder image user
default: "1000"
- name: CACHE
description: The name of the volume to use for the build cache.
default: empty-dir
steps:
- name: prepare
image: ubuntu:18.04
command: ["/bin/sh"]
args:
- "-c"
- >
chown -R "${USER_ID}:${GROUP_ID}" "/builder/home" &&
chown -R "${USER_ID}:${GROUP_ID}" /layers &&
chown -R "${USER_ID}:${GROUP_ID}" /workspace
volumeMounts:
- name: ${CACHE}
mountPath: /layers
imagePullPolicy: Always
- name: detect
image: ${BUILDER_IMAGE}
command: ["/lifecycle/detector"]
args:
- "-app=/workspace"
- "-group=/layers/group.toml"
- "-plan=/layers/plan.toml"
volumeMounts:
- name: ${CACHE}
mountPath: /layers
imagePullPolicy: Always
- name: analyze
image: ${BUILDER_IMAGE}
command: ["/lifecycle/analyzer"]
args:
- "-layers=/layers"
- "-helpers=${USE_CRED_HELPERS}"
- "-group=/layers/group.toml"
- "${IMAGE}"
volumeMounts:
- name: ${CACHE}
mountPath: /layers
imagePullPolicy: Always
- name: build
image: ${BUILDER_IMAGE}
command: ["/lifecycle/builder"]
args:
- "-layers=/layers"
- "-app=/workspace"
- "-group=/layers/group.toml"
- "-plan=/layers/plan.toml"
volumeMounts:
- name: ${CACHE}
mountPath: /layers
imagePullPolicy: Always
- name: export
image: ${BUILDER_IMAGE}
command: ["/lifecycle/exporter"]
args:
- "-layers=/layers"
- "-helpers=${USE_CRED_HELPERS}"
- "-app=/workspace"
- "-image=${RUN_IMAGE}"
- "-group=/layers/group.toml"
- "${IMAGE}"
volumeMounts:
- name: ${CACHE}
mountPath: /layers
imagePullPolicy: Always
volumes:
- name: empty-dir
emptyDir: {}

0 comments on commit 5760af1

Please sign in to comment.