-
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
db9fe0e
e66c2b6
0c20142
c796e4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We ought to prompt for a license key, too, or have some way to easily pull it from somewhere. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can open Foundry then using the provided launch.json (or just by running a command in the devcontainer) and it will ask you for serial number. I don't know how to provide it differently, but I will take a look |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
* text=auto | ||
system.json filter=mungePackageID |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ ose-dev.lock | |
dist | ||
.DS_Store | ||
.env | ||
.foundrycache | ||
foundry.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
// Użyj funkcji IntelliSense, aby uzyskać informacje o możliwych atrybutach. | ||
// Najedź kursorem, aby wyświetlić opisy istniejących atrybutów. | ||
// Aby uzyskać więcej informacji, odwiedź stronę: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"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" | ||
] | ||
} | ||
] | ||
} |
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?