|
| 1 | +# Copyright 2019 TriggerMesh, Inc |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +apiVersion: build.knative.dev/v1alpha1 |
| 16 | +kind: BuildTemplate |
| 17 | +metadata: |
| 18 | + name: knative-ruby25-runtime |
| 19 | +spec: |
| 20 | + parameters: |
| 21 | + - name: BASEIMAGE_REGISTRY |
| 22 | + default: gcr.io |
| 23 | + - name: BASEIMAGE_TAG |
| 24 | + default: latest |
| 25 | + - name: IMAGE |
| 26 | + description: The URI of the image to push, including registry host |
| 27 | + - name: TAG |
| 28 | + description: Tag of the image being pushed |
| 29 | + default: latest |
| 30 | + - name: DIRECTORY |
| 31 | + description: The subdirectory of the workspace/repo |
| 32 | + default: "" |
| 33 | + - name: HANDLER |
| 34 | + default: "function.handler" |
| 35 | + steps: |
| 36 | + - name: dockerfile |
| 37 | + image: gcr.io/kaniko-project/executor@sha256:30ba460a034a8051b3222a32e20cb6049741e58384e3adf8c8987c004e2f2ab9 |
| 38 | + command: |
| 39 | + - /busybox/sh |
| 40 | + args: |
| 41 | + - -c |
| 42 | + - | |
| 43 | + cd /workspace/${DIRECTORY} |
| 44 | + cat <<EOF > Dockerfile |
| 45 | + FROM ${BASEIMAGE_REGISTRY}/triggermesh/knative-lambda-runtime-ruby25:${BASEIMAGE_TAG} |
| 46 | + ENV _HANDLER "${HANDLER}" |
| 47 | +
|
| 48 | + COPY . . |
| 49 | + ENTRYPOINT ["/opt/aws-custom-runtime"] |
| 50 | + EOF |
| 51 | + - name: export |
| 52 | + image: gcr.io/kaniko-project/executor@sha256:30ba460a034a8051b3222a32e20cb6049741e58384e3adf8c8987c004e2f2ab9 |
| 53 | + args: |
| 54 | + - --context=/workspace/${DIRECTORY} |
| 55 | + - --dockerfile=/workspace/${DIRECTORY}/Dockerfile |
| 56 | + - --destination=${IMAGE}:${TAG} |
0 commit comments