Skip to content

Commit 9773389

Browse files
committed
[preview] Fix broken shortname assignment in preview envs
1 parent 6d7d538 commit 9773389

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

.werft/jobs/build/installer/installer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class Installer {
119119
private configureMetadata(slice: string): void {
120120
exec(`cat <<EOF > shortname.yaml
121121
metadata:
122-
shortname: ""
122+
shortname: "dev"
123123
EOF`);
124124
exec(`yq m -ix ${this.options.installerConfigPath} shortname.yaml`, { slice: slice });
125125
}

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ while [ "$documentIndex" -le "$DOCS" ]; do
103103
yq m --arrays=overwrite -i k8s.yaml -d "$documentIndex" /tmp/"$NAME"pool.yaml
104104
fi
105105

106+
SHORT_NAME="dev"
106107
# overrides for server-config
107108
if [[ "server-config" == "$NAME" ]] && [[ "$KIND" == "ConfigMap" ]]; then
108109
WORK="overrides for $NAME $KIND"
@@ -113,12 +114,6 @@ while [ "$documentIndex" -le "$DOCS" ]; do
113114
DEV_BRANCH_EXPR="s/\"devBranch\": \"\"/\"devBranch\": \"$DEV_BRANCH\"/"
114115
sed -i "$DEV_BRANCH_EXPR" /tmp/"$NAME"overrides.yaml
115116

116-
# InstallationShortname
117-
# is expected to look like ws-dev.<branch-name-with-dashes>.staging.gitpod-dev.com
118-
SHORT_NAME=$(yq r ./.werft/jobs/build/helm/values.dev.yaml installation.shortname)
119-
NAMESPACE=$(kubens -c)
120-
INSTALL_SHORT_NAME_EXPR="s/\"installationShortname\": \"$NAMESPACE\"/\"installationShortname\": \"$SHORT_NAME\"/"
121-
sed -i "$INSTALL_SHORT_NAME_EXPR" /tmp/"$NAME"overrides.yaml
122117
# Stage
123118
STAGE=$(yq r ./.werft/jobs/build/helm/values.dev.yaml installation.stage)
124119
STAGE_EXPR="s/\"stage\": \"production\"/\"stage\": \"$STAGE\"/"
@@ -154,10 +149,6 @@ while [ "$documentIndex" -le "$DOCS" ]; do
154149
touch /tmp/"$NAME"overrides.yaml
155150
yq r k8s.yaml -d "$documentIndex" data | yq prefix - data > /tmp/"$NAME"overrides.yaml
156151

157-
# simliar to server, except the ConfigMap hierarchy, key, and value are different
158-
SHORT_NAME=$(yq r ./.werft/jobs/build/helm/values.dev.yaml installation.shortname)
159-
INSTALL_SHORT_NAME_EXPR="s/\"installation\": \"\"/\"installation\": \"$SHORT_NAME\"/"
160-
sed -i "$INSTALL_SHORT_NAME_EXPR" /tmp/"$NAME"overrides.yaml
161152
yq m -x -i k8s.yaml -d "$documentIndex" /tmp/"$NAME"overrides.yaml
162153
fi
163154

@@ -175,7 +166,6 @@ while [ "$documentIndex" -le "$DOCS" ]; do
175166
touch /tmp/"$NAME"overrides.yaml
176167
yq r k8s.yaml -d "$documentIndex" data | yq prefix - data > /tmp/"$NAME"overrides.yaml
177168

178-
SHORT_NAME=$(yq r ./.werft/jobs/build/helm/values.dev.yaml installation.shortname)
179169
STAGING_HOST_NAME=$(yq r ./.werft/jobs/build/helm/values.dev.yaml hostname)
180170
CURRENT_WS_HOST_NAME="ws.$DEV_BRANCH.$STAGING_HOST_NAME"
181171
NEW_WS_HOST_NAME="ws-$SHORT_NAME.$DEV_BRANCH.$STAGING_HOST_NAME"
@@ -222,7 +212,6 @@ while [ "$documentIndex" -le "$DOCS" ]; do
222212
yq r k8s.yaml -d "$documentIndex" data | yq prefix - data > /tmp/"$NAME"overrides.yaml
223213

224214
# simliar to server, except the ConfigMap hierarchy, key, and value are different
225-
SHORT_NAME=$(yq r ./.werft/jobs/build/helm/values.dev.yaml installation.shortname)
226215
STAGING_HOST_NAME=$(yq r ./.werft/jobs/build/helm/values.dev.yaml hostname)
227216
CURRENT_WS_HOST_NAME="ws.$DEV_BRANCH.$STAGING_HOST_NAME"
228217
NEW_WS_HOST_NAME="ws-$SHORT_NAME.$DEV_BRANCH.$STAGING_HOST_NAME"

0 commit comments

Comments
 (0)