Skip to content

Commit 7c6766c

Browse files
mustard-mhroboquat
authored andcommitted
[werft] add public api token service support for preview environment
1 parent 3f040eb commit 7c6766c

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.werft/jobs/build/installer/post-process.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ if [[ -f "/tmp/payment" ]] ; then
4040
printf \\n'---'\\n >> k8s.yaml
4141
cat "/tmp/payment" >> k8s.yaml
4242
fi
43+
# if public-api is configured: Append the YAML objects
44+
if [[ -f "/tmp/public-api" ]] ; then
45+
echo "found /tmp/public-api, appending to k8s.yaml now"
46+
# do not make any assumptions about new lines
47+
printf \\n'---'\\n >> k8s.yaml
48+
cat "/tmp/public-api" >> k8s.yaml
49+
fi
4350

4451
# count YAML like lines in the k8s manifest file
4552
MATCHES="$(grep -c -- --- k8s.yaml)"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
data:
3+
personal-access-token-signing-key: Zm9vCg==
4+
kind: Secret
5+
metadata:
6+
name: personal-access-token-signing-key
7+
namespace: default
8+
type: Opaque

dev/preview/workflow/preview/deploy-gitpod.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,11 @@ yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.configcatKey "WBLaCPtkjkq
383383
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.proxy.configcat.baseUrl "https://cdn-global.configcat.com"
384384
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.proxy.configcat.pollInterval "1m"
385385

386+
#
387+
# configurePublicAPI
388+
#
389+
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.publicApi.personalAccessTokenSigningKeySecretName "personal-access-token-signing-key"
390+
386391
#
387392
# configureDefaultTemplate
388393
#
@@ -489,6 +494,16 @@ for manifest in "$ROOT"/.werft/jobs/build/payment/*.yaml; do
489494
echo "---" >> /tmp/payment
490495
done
491496

497+
#
498+
# configurePublicAPI
499+
#
500+
501+
rm -f /tmp/public-api
502+
for manifest in "$ROOT"/.werft/jobs/build/public-api/*.yaml; do
503+
cat "$manifest" >> /tmp/public-api
504+
echo "---" >> /tmp/public-api
505+
done
506+
492507
#
493508
# Run post-process script
494509
#
@@ -501,6 +516,7 @@ WITH_VM=true "$ROOT/.werft/jobs/build/installer/post-process.sh" "${PREVIEW_NAME
501516
rm -f /tmp/payment
502517
rm -f /tmp/defaultFeatureFlags
503518
rm -f /tmp/license
519+
rm -f /tmp/public-api
504520

505521
# ===============
506522
# Install

0 commit comments

Comments
 (0)