-
Notifications
You must be signed in to change notification settings - Fork 4
/
release.sh
executable file
·30 lines (22 loc) · 960 Bytes
/
release.sh
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
#!/usr/bin/env bash
set -euo pipefail
version=$(cat LATEST_VERSION)
echo "Flux version: $version"
echo "Generating the manifests using the built CLI ..."
manifest="manifests-$version.yaml"
echo "Exporting gotk-components.yaml ..."
docker run --rm -it ghcr.io/fluxcd/flux-cli:v${version} install \
--components-extra=image-reflector-controller,image-automation-controller \
--export > gotk-components.yaml
echo "Patch to remove fsGroup with Kustomize ..."
# require kustomize 4.1.3
kustomize build . > "$manifest"
QUERY=".spec.template.spec.containers[0].image"
source_controller_image=$(yq e "$QUERY | select(. == \"*source-controller*\")" gotk-components.yaml)
echo "Calling release js ..."
./release.js "${manifest}" "${version}" "${source_controller_image}"
echo "Bundle with operator-sdk ..."
operator-sdk bundle validate --select-optional name=operatorhub --verbose "flux/$version"
echo "Clean up ..."
# rm gotk-components.yaml
rm "$manifest"