Skip to content

Commit 7cdc188

Browse files
Add a bundled crds to the release
Signed-off-by: mikkeldamsgaard <[email protected]>
1 parent f9221d7 commit 7cdc188

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.goreleaser.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,15 @@ archives:
100100
- kubectl-create-workspace
101101
name_template: "kubectl-create-workspace-plugin_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
102102

103+
before:
104+
hooks:
105+
- config/crds/crd-bundler.sh
106+
103107
release:
104108
draft: true
105109
mode: keep-existing
110+
extra_files:
111+
- glob: ./config/crds/crds.yaml
106112

107113
krews:
108114
- name: kcp

config/crds/crd-bundler.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
# This script bundles CRDs to be used in relation to goreleaser.
4+
CRDS_DIR=$(dirname "${0}")
5+
6+
CRDS_FILE="${CRDS_DIR}/crds.yaml"
7+
rm -f ${CRDS_FILE}
8+
for file in ${CRDS_DIR}/apis.kcp.*.yaml ${CRDS_DIR}/cache.kcp.*.yaml \
9+
${CRDS_DIR}/core.kcp.*.yaml ${CRDS_DIR}/tenancy.kcp.*.yaml \
10+
${CRDS_DIR}/topology.kcp.*.yaml; do
11+
cat ${file} >> "${CRDS_FILE}"
12+
echo "--" >> "${CRDS_FILE}"
13+
echo ${file} >> /tmp/debug
14+
done

0 commit comments

Comments
 (0)