forked from shipwright-io/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildstrategy_buildpacks-v3-heroku_namespaced_cr.yaml
73 lines (67 loc) · 1.72 KB
/
buildstrategy_buildpacks-v3-heroku_namespaced_cr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
apiVersion: shipwright.io/v1alpha1
kind: BuildStrategy
metadata:
name: buildpacks-v3-heroku
spec:
buildSteps:
- name: prepare
image: heroku/buildpacks:18
securityContext:
runAsUser: 0
capabilities:
add:
- CHOWN
command:
- chown
args:
- -R
- "1000:1000"
- /tekton/home
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 250m
memory: 65Mi
- name: build-and-push
image: heroku/buildpacks:18
securityContext:
runAsUser: 1000
runAsGroup: 1000
command:
- /bin/bash
args:
- -c
- |
set -euo pipefail
mkdir /tmp/cache /tmp/layers
echo "> Processing environment variables..."
ENV_DIR="/platform/env"
envs=($(env))
for env in "${envs[@]}"; do
IFS='=' read -r key value string <<< "$env"
if [[ "$key" != "" ]]; then
path="${ENV_DIR}/${key}"
echo -n "$value" > "$path"
fi
done
/cnb/lifecycle/creator \
'-app=$(params.shp-source-context)' \
-cache-dir=/tmp/cache \
-layers=/tmp/layers \
-report=/tmp/report.toml \
'$(params.shp-output-image)'
# Store the image digest
grep digest /tmp/report.toml | tr -d ' \"\n' | sed s/digest=// > "$(results.shp-image-digest.path)"
volumeMounts:
- mountPath: /platform/env
name: platform-env
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 250m
memory: 65Mi