[IMP] travis2docker: Preinstall VS Code server and add devcontainer.json - #240
Merged
Merged
Conversation
Opt-in with the DEPLOYV_VSCODE=1 environment variable so vim/terminal users do not pay the extra build time downloading VS Code artifacts: - The Dockerfile pre-installs the VS Code server pinned to the commit of the local 'code' binary (falling back to the latest stable) and the extensions of templates/.vscode/extensions.json at build time, so attaching VS Code to the container does not install anything live - Generate a .devcontainer.json next to the Dockerfile pointing to the image built by 10-build.sh so VS Code offers 'Reopen in Container' Based on the idea of Vauxoo#169 by @antonag32 Related to Vauxoo#158
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reimplements the idea of #169 (credit to @antonag32) on top of the current
main, extended with build-time pre-installation of the VS Code tooling. Related to #158.Everything is opt-in with the environment variable
DEPLOYV_VSCODE=1, so vim/terminal users are not affected at all (no extra build time, no extra files):DEPLOYV_VSCODE=1 travisfile2dockerfile git@github.com:Vauxoo/forecast.git 8.0When enabled:
codebinary (code --version), falling back to the latest stable whencodeis not in PATH. If the pinned server ever mismatches the client, VS Code just downloads its own version as usual (graceful fallback).templates/.vscode/extensions.json(single source of truth, no duplicated list) and are installed into~/.vscode-server/extensions, which is server-version independent, so they survive client upgrades.x86_64andarm64images..devcontainer.jsonis generated next to the Dockerfile pointing to the image built by10-build.sh(instead of rebuilding from the Dockerfile, which would lose--build-env-args), withremoteUser: odoo,workspaceFolder: /home/odoo/instanceandpython.analysis.extraPathsfor Odoo source navigation. Opening the generated folder in VS Code offers Reopen in Container automatically.Differences vs #169: rebased onto the pathlib/deployv-only codebase,
remoteUserisodooinstead ofroot, usesimageinstead ofdockerFile, the extension list is not duplicated, gated behind the env var, and covered by tests.