-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial setup for devcontainers for OSE project #556
Merged
Rughalt
merged 4 commits into
main
from
555-simplify-development-environment-setup-for-the-project
Feb 2, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
db9fe0e
Initial setup for devcontainers for OSE project
Rughalt e66c2b6
Fix caching issue and add neovim to devcontainer
Rughalt 0c20142
Remove polish comments from the launch.json
Rughalt c796e4f
Change permissions for setup-foundry script
Rughalt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,24 @@ | ||
{ | ||
"name": "Node.js & TypeScript", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm", | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {}, | ||
"ghcr.io/duduribeiro/devcontainer-features/neovim:1": { | ||
"version": "nightly" | ||
} | ||
}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ | ||
30000 | ||
], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// Ask the user to provide foundry install url; download and unpack foundry; | ||
// Start the foundry server; link the workspace to the foundry's data/systems/D35E folder | ||
"postCreateCommand": "./.devcontainer/setup-foundry.sh", | ||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
"remoteUser": "root" | ||
} |
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,29 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -d "/home/node/.foundryvtt" ]; then | ||
# Check if there is a .foundrycache folder in the workspace and it has at least one file | ||
if [ -d "/workspaces/ose/.foundrycache" ] && [ "$(ls -A /workspaces/ose/.foundrycache)" ]; then | ||
# Find the newest file in the .foundrycache directory | ||
cachedFoundryFile=$(ls -t /workspaces/ose/.foundrycache/*.zip | head -1) | ||
echo "Using cached FoundryVTT file $cachedFoundryFile" | ||
cp "/workspaces/ose/.foundrycache/$(basename "$cachedFoundryFile")" . | ||
foundryFile=$(basename "$cachedFoundryFile") | ||
else | ||
echo 'Please provide the FoundryVTT timed URL from https://foundryvtt.com/. Select the Linux/Node.js operating system.' | ||
read -p 'FoundryVTT URL: ' foundryUrl | ||
# Get the filename from the URL | ||
foundryFile=$(basename "$foundryUrl" | cut -d'?' -f1) | ||
echo "Downloading $foundryFile" | ||
curl -L "$foundryUrl" -o "$foundryFile" | ||
echo "Copying $foundryFile to .foundrycache" | ||
mkdir -p /workspaces/ose/.foundrycache | ||
cp "$foundryFile" /workspaces/ose/.foundrycache | ||
fi | ||
# quietly unzip the file | ||
echo "Unzipping $foundryFile" | ||
unzip "$foundryFile" -d /home/node/.foundryvtt > /dev/null | ||
rm "$foundryFile" | ||
mkdir -p /home/node/.foundrydata/Data/systems | ||
fi | ||
|
||
ln -s /workspaces/ose /home/node/.foundrydata/Data/systems/ose-dev |
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 +1,2 @@ | ||
* text=auto | ||
system.json filter=mungePackageID |
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 |
---|---|---|
|
@@ -5,3 +5,5 @@ ose-dev.lock | |
dist | ||
.DS_Store | ||
.env | ||
.foundrycache | ||
foundry.zip |
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 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Build & Watch via NPM", | ||
"type": "node", | ||
"request": "launch", | ||
"runtimeExecutable": "npm", | ||
"runtimeArgs": [ | ||
"run", | ||
"build:watch" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
] | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch FoundryVTT", | ||
"program": "/home/node/.foundryvtt/resources/app/main.js", | ||
"args": [ | ||
"--dataPath=/home/node/.foundrydata" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
"runtimeExecutable": "node", | ||
"runtimeArgs": [ | ||
"--inspect=9229" | ||
], | ||
"env": { | ||
"NODE_ENV": "development" | ||
}, | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
] | ||
} | ||
], | ||
"compounds": [ | ||
{ | ||
"name": "Build & Launch FoundryVTT", | ||
"configurations": [ | ||
"Build & Watch via NPM", | ||
"Launch FoundryVTT" | ||
] | ||
} | ||
] | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's a way to add LazyVim or Astro to this config?