-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22814 from mshima/skip_ci-devcontainer
add devcontainer for jhipster development
- Loading branch information
Showing
8 changed files
with
155 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java/.devcontainer/base.Dockerfile | ||
|
||
# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster | ||
ARG VARIANT="17-bullseye" | ||
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT} | ||
|
||
# [Choice] Node.js version: none, lts/*, defaults to generator-jhipster default node version. | ||
ARG NODE_VERSION | ||
|
||
# Copy required generator-jhipster resource to detect node and npm versions | ||
COPY /package.json /tmp/generator-jhipster/ | ||
COPY /generators /tmp/generator-jhipster/generators | ||
COPY /test-integration /tmp/generator-jhipster/test-integration | ||
|
||
RUN /tmp/generator-jhipster/test-integration/scripts/99-print-node-version.sh | ||
RUN export NODE_VERSION=${NODE_VERSION:-$(/tmp/generator-jhipster/test-integration/scripts/99-print-node-version.sh)}; \ | ||
su -p vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install $NODE_VERSION 2>&1"; | ||
RUN npm install -g npm@$(/tmp/generator-jhipster/test-integration/scripts/99-print-npm-version.sh); \ | ||
npm cache clean --force | ||
|
||
# Remove generator-jhipster for final image | ||
RUN rm -rf /tmp/generator-jhipster |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java | ||
{ | ||
"name": "generator-jhipster", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "..", | ||
"args": { | ||
// Update the VARIANT arg to pick a Java version: 11, 17 | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use the -bullseye variants on local arm64/Apple Silicon. | ||
"VARIANT": "17-bullseye" | ||
|
||
// Defaults to generator-jhipster's default node version. | ||
//"NODE_VERSION": "" | ||
} | ||
}, | ||
"mounts": [ | ||
// If your system OS/Architecture doesn't matches the container one, you can uncomment the following line and create node_modules_container to keep local and containers node_module usable. | ||
// "source=${localWorkspaceFolder}/node_modules_container,target=/workspaces/generator-jhipster/node_modules,type=bind,consistency=cached", | ||
"source=${localWorkspaceFolder}/../jhipster-samples,target=/workspaces/jhipster-samples,type=bind,consistency=cached" | ||
], | ||
|
||
"customizations": { | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"java.jdt.ls.java.home": "/docker-java-home" | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": ["eamodio.gitlens", "esbenp.prettier-vscode", "github.vscode-github-actions", "hbenl.vscode-mocha-test-adapter"] | ||
} | ||
}, | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Uncomment the next line to run commands after the container is created. | ||
// "postCreateCommand": "cat /etc/os-release", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
node_modules_container | ||
coverage | ||
.idea | ||
*.iml | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
node_modules_container | ||
docs | ||
.git | ||
jdl/**/.jhipster/** | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
source $(dirname $0)/00-init-env.sh | ||
|
||
echo $JHI_NPM_VERSION |