Skip to content

Commit

Permalink
Migration to upstream code server
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 authored and roboquat committed Oct 27, 2021
1 parent c146759 commit 5f84be7
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion WORKSPACE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defaultArgs:
npmPublishTrigger: "false"
publishToNPM: true
localAppVersion: unknown
codeCommit: 128bab190731bc4af1a6e58b9324110a0d087884
codeCommit: f14b5f5730b57a05656c1fef9de2f2c22ee8a0c1

defaultVariant:
srcs:
Expand Down
2 changes: 1 addition & 1 deletion components/ide/code/bin/code
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
/ide/node /ide/out/gitpod-cli.js "$@"
exec /ide/bin/gitpod-code "$@"
2 changes: 0 additions & 2 deletions components/ide/code/bin/gitpod-code

This file was deleted.

2 changes: 2 additions & 0 deletions components/ide/code/bin/gp-code
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
exec /ide/bin/gitpod-code "$@"
2 changes: 1 addition & 1 deletion components/ide/code/bin/open
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
/ide/node /ide/out/gitpod-cli.js "$@"
exec /ide/bin/gitpod-code "$@"
32 changes: 20 additions & 12 deletions components/ide/code/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,38 @@ RUN mkdir gp-code \
WORKDIR /gp-code
RUN yarn --frozen-lockfile --network-timeout 180000
RUN yarn --cwd ./extensions compile
RUN yarn gulp gitpod-min

# grant write permissions for built-in extensions
RUN chmod -R ugo+w /gitpod-pkg-server/extensions

# cli config
RUN yarn gulp vscode-web-min
RUN yarn gulp vscode-reh-linux-x64-min

# config for first layer needed by blobserve
# we also remove `static/` from resource urls as that's needed by blobserve,
# this custom urls will be then replaced by blobserve.
# Check pkg/blobserve/blobserve.go, `inlineVars` method
RUN cp /vscode-web/out/vs/gitpod/browser/workbench/workbench.html /vscode-web/index.html \
&& sed -i -e 's#static/##g' /vscode-web/index.html

# cli config: alises to gitpod-code
# can't use relative symlink as they break when copied to the image below
COPY bin /ide/bin
RUN chmod -R ugo+x /ide/bin

# grant write permissions for built-in extensions
RUN chmod -R ugo+w /vscode-reh-linux-x64/extensions

FROM scratch
# copy static web resources in first layer to serve from blobserve
COPY --from=code_installer --chown=33333:33333 /gitpod-pkg-web/ /ide/
COPY --from=code_installer --chown=33333:33333 /gitpod-pkg-server/ /ide/
COPY --from=code_installer --chown=33333:33333 /vscode-web/ /ide/
COPY --from=code_installer --chown=33333:33333 /vscode-reh-linux-x64/ /ide/
COPY --chown=33333:33333 startup.sh supervisor-ide-config.json /ide/

# cli config
COPY --from=code_installer --chown=33333:33333 /ide/bin /ide/bin

ENV GITPOD_ENV_APPEND_PATH /ide/bin:

# editor config
ENV GITPOD_ENV_SET_EDITOR /ide/bin/code
ENV GITPOD_ENV_SET_EDITOR /ide/bin/gitpod-code
ENV GITPOD_ENV_SET_VISUAL "$GITPOD_ENV_SET_EDITOR"
ENV GITPOD_ENV_SET_GP_OPEN_EDITOR "$GITPOD_ENV_SET_EDITOR"
ENV GITPOD_ENV_SET_GIT_EDITOR "$GITPOD_ENV_SET_EDITOR --wait"
ENV GITPOD_ENV_SET_GP_PREVIEW_BROWSER "/ide/bin/code --preview"
ENV GITPOD_ENV_SET_GP_EXTERNAL_BROWSER "/ide/bin/code --openExternal"
ENV GITPOD_ENV_SET_GP_PREVIEW_BROWSER "/ide/bin/gitpod-code --preview"
ENV GITPOD_ENV_SET_GP_EXTERNAL_BROWSER "/ide/bin/gitpod-code --openExternal"
4 changes: 2 additions & 2 deletions components/ide/code/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ grep -rl open-vsx.org /ide | xargs sed -i "s|https://open-vsx.org|$VSX_REGISTRY_

cd /ide || exit
if [ "$SUPERVISOR_DEBUG_ENABLE" = "true" ]; then
exec /ide/node --inspect ./out/gitpod.js "$@" --verbose --log=trace
exec /ide/server.sh --inspect --verbose --log trace --connectionToken 00000 "$@"
else
exec /ide/node ./out/gitpod.js "$@"
exec /ide/server.sh --connectionToken 00000 "$@"
fi

0 comments on commit 5f84be7

Please sign in to comment.