Skip to content

Commit

Permalink
Add code web extension as package
Browse files Browse the repository at this point in the history
  • Loading branch information
iQQBot committed Apr 24, 2024
1 parent 818c89b commit eb849be
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 8 deletions.
1 change: 1 addition & 0 deletions WORKSPACE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ defaultArgs:
codeCommit: 0859efdc73ff89d823efce9288ead6d36080f315
codeVersion: 1.88.0
codeQuality: stable
codeWebExtensionCommit: 7ff72a2938a7a06cbdf3964590f7e9b7525958f3
noVerifyJBPlugin: false
intellijDownloadUrl: "https://download.jetbrains.com/idea/ideaIU-2024.1.tar.gz"
golandDownloadUrl: "https://download.jetbrains.com/go/goland-2024.1.tar.gz"
Expand Down
15 changes: 15 additions & 0 deletions components/ide/code/code-extension/BUILD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
packages:
- name: docker
type: docker
argdeps:
- imageRepoBase
- codeWebExtensionCommit
config:
dockerfile: leeway.Dockerfile
metadata:
helm-component: workspace.codeWebExtensionImage
buildArgs:
CODE_EXTENSION_COMMIT: ${codeWebExtensionCommit}
image:
- ${imageRepoBase}/ide/gitpod-code-web:${version}
- ${imageRepoBase}/ide/gitpod-code-web:commit-${__git_commit}
33 changes: 33 additions & 0 deletions components/ide/code/code-extension/leeway.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
# Licensed under the GNU Affero General Public License (AGPL).
# See License.AGPL.txt in the project root for license information.
FROM node:18 as builder

ARG CODE_EXTENSION_COMMIT

RUN apt update -y \
&& apt install jq --no-install-recommends -y

RUN mkdir /gitpod-code-web \
&& cd /gitpod-code-web \
&& git init \
&& git remote add origin https://github.com/gitpod-io/gitpod-code \
&& git fetch origin $CODE_EXTENSION_COMMIT --depth=1 \
&& git reset --hard FETCH_HEAD
WORKDIR /gitpod-code-web
RUN yarn --frozen-lockfile --network-timeout 180000

# update package.json
RUN setSegmentKey="setpath([\"segmentKey\"]; \"untrusted-dummy-key\")" && \
jqCommands="${setSegmentKey}" && \
cat package.json | jq "${jqCommands}" > package.json.tmp && \
mv package.json.tmp package.json
RUN yarn build:gitpod-web && yarn --cwd gitpod-web/ inject-commit-hash


FROM scratch

COPY --from=builder --chown=33333:33333 /gitpod-code-web/gitpod-web/out /ide/extensions/gitpod-web/out/
COPY --from=builder --chown=33333:33333 /gitpod-code-web/gitpod-web/public /ide/extensions/gitpod-web/public/
COPY --from=builder --chown=33333:33333 /gitpod-code-web/gitpod-web/resources /ide/extensions/gitpod-web/resources/
COPY --from=builder --chown=33333:33333 /gitpod-code-web/gitpod-web/package.json /gitpod-code-web/gitpod-web/package.nls.json /gitpod-code-web/gitpod-web/README.md /gitpod-code-web/gitpod-web/LICENSE.txt /ide/extensions/gitpod-web/
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func ideConfigConfigmap(ctx *common.RenderContext) ([]runtime.Object, error) {
CodeBrowserVersionStable: ide.CodeIDEImageStableVersion,
ResolvedCodeBrowserImageLatest: resolveLatestImage(ide.CodeIDEImage, "nightly", ctx.VersionManifest.Components.Workspace.CodeImage),
CodeHelperImage: ctx.ImageName(ctx.Config.Repository, ide.CodeHelperIDEImage, ctx.VersionManifest.Components.Workspace.CodeHelperImage.Version),
CodeWebExtensionImage: ctx.ImageName(ctx.Config.Repository, ide.CodeWebExtensionImage, ide.CodeWebExtensionVersion),
CodeWebExtensionImage: ctx.ImageName(ctx.Config.Repository, ide.CodeWebExtensionImage, ctx.VersionManifest.Components.Workspace.CodeWebExtensionImage.Version),

JetBrainsPluginImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.JetBrainsBackendPluginImage.Version),
JetBrainsPluginLatestImage: ctx.ImageName(ctx.Config.Repository, ide.JetBrainsBackendPluginImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.JetBrainsBackendPluginLatestImage.Version),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const (
Code1_85IDEImageStableVersion = "commit-cb1173f2a457633550a7fdc89af86d8d4da51876"
CodeHelperIDEImage = "ide/code-codehelper"
CodeWebExtensionImage = "ide/gitpod-code-web"
CodeWebExtensionVersion = "commit-4e069a6195f3926ba8b84725bc806228f4cb94ec" // gitpod-web extension version comes from https://github.com/gitpod-io/gitpod-code
CodeDesktopIDEImage = "ide/code-desktop"
CodeDesktopInsidersIDEImage = "ide/code-desktop-insiders"
XtermIDEImage = "ide/xterm-web"
Expand Down
13 changes: 7 additions & 6 deletions install/installer/pkg/config/versions/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ type Components struct {
ServiceWaiter Versioned `json:"serviceWaiter"`
Usage Versioned `json:"usage"`
Workspace struct {
CodeImage Versioned `json:"codeImage"`
CodeHelperImage Versioned `json:"codeHelperImage"`
DockerUp Versioned `json:"dockerUp"`
Supervisor Versioned `json:"supervisor"`
Workspacekit Versioned `json:"workspacekit"`
DesktopIdeImages struct {
CodeImage Versioned `json:"codeImage"`
CodeHelperImage Versioned `json:"codeHelperImage"`
CodeWebExtensionImage Versioned `json:"codeWebExtensionImage"`
DockerUp Versioned `json:"dockerUp"`
Supervisor Versioned `json:"supervisor"`
Workspacekit Versioned `json:"workspacekit"`
DesktopIdeImages struct {
CodeDesktopImage Versioned `json:"codeDesktop"`
CodeDesktopImageInsiders Versioned `json:"codeDesktopInsiders"`
IntelliJImage Versioned `json:"intellij"`
Expand Down

0 comments on commit eb849be

Please sign in to comment.