Skip to content

Commit 330a901

Browse files
committed
fix inline static replacements for code
1 parent 577b17e commit 330a901

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

components/ide/code/leeway.Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,14 @@ RUN yarn --cwd extensions compile \
7373
&& yarn gulp vscode-reh-linux-x64-min
7474

7575
# config for first layer needed by blobserve
76-
# we also remove `static/` from resource urls as that's needed by blobserve,
77-
# this custom urls will be then replaced by blobserve.
76+
# we also parametrize IDE and supervisors urls,
77+
# these urls will be then inlined by blobserve.
7878
# Check pkg/blobserve/blobserve.go, `inlineVars` method
7979
RUN cp /vscode-web/out/vs/gitpod/browser/workbench/workbench.html /vscode-web/index.html \
8080
&& cp /vscode-web/out/vs/gitpod/browser/workbench/callback.html /vscode-web/callback.html \
81-
&& sed -i -e 's#baseUrl =.*;#baseUrl = window.location.origin;#g' /vscode-web/index.html \
82-
&& sed -i -e 's#{{WORKBENCH_WEB_BASE_URL}}#.#g' /vscode-web/index.html \
81+
&& sed -i -e 's#baseUrl =.*;#baseUrl = "${ide}";#g' /vscode-web/index.html \
82+
&& sed -i -e 's#{{WORKBENCH_WEB_BASE_URL}}#${ide}#g' /vscode-web/index.html \
83+
&& sed -i -e 's#/_supervisor/frontend#${supervisor}#g' /vscode-web/index.html \
8384
&& sed -i -e "s/{{VERSION}}/$CODE_QUALITY-$CODE_COMMIT/g" /vscode-web/index.html
8485

8586
# cli config: alises to gitpod-code

install/installer/pkg/components/blobserve/configmap.go

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,24 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
7474
Replacement: fmt.Sprintf("ide.%s/code/marketplace.json", ctx.Config.Domain),
7575
Path: "/ide/out/vs/workbench/workbench.web.main.js",
7676
}},
77-
InlineStatic: []blobserve.InlineReplacement{{
78-
Search: "${window.location.origin}",
79-
Replacement: ".",
80-
}, {
81-
Search: "value.startsWith(window.location.origin)",
82-
Replacement: "value.startsWith(window.location.origin) || value.startsWith('${ide}')",
83-
}, {
84-
Search: "./out",
85-
Replacement: "${ide}/out",
86-
}, {
87-
Search: "./node_modules",
88-
Replacement: "${ide}/node_modules",
89-
}, {
90-
Search: "/_supervisor/frontend",
91-
Replacement: "${supervisor}",
92-
}},
77+
InlineStatic: []blobserve.InlineReplacement{
78+
// deprecated, instead replacement happens in the code image
79+
{
80+
Search: "${window.location.origin}",
81+
Replacement: ".",
82+
}, {
83+
Search: "value.startsWith(window.location.origin)",
84+
Replacement: "value.startsWith(window.location.origin) || value.startsWith('${ide}')",
85+
}, {
86+
Search: "./out",
87+
Replacement: "${ide}/out",
88+
}, {
89+
Search: "./node_modules",
90+
Replacement: "${ide}/node_modules",
91+
}, {
92+
Search: "/_supervisor/frontend",
93+
Replacement: "${supervisor}",
94+
}},
9395
},
9496
ctx.RepoName(ctx.Config.Repository, workspace.SupervisorImage): {
9597
PrePull: []string{},

0 commit comments

Comments
 (0)