From 40573333c59d0fcdf300c492dc264fef98c62c39 Mon Sep 17 00:00:00 2001 From: Fabiano Weimar Date: Sat, 30 Nov 2024 14:30:09 +0000 Subject: [PATCH 1/3] Initial dev container implementation for vscode. --- .devcontainer/devcontainer.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..2795526db9 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,18 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Plone 6.1", + "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye" + + // Use 'portsAttributes' to set default properties for specific forwarded ports. + // More info: https://containers.dev/implementors/json_reference/#port-attributes + "portsAttributes": { + "8080": { + "label": "Plone Backend", + "onAutoForward": "notify" + } + }, + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pip3 install --user -r requirements.txt" +} From 1d319fb5ec1a4800f3b97a9b495e3ed6ae8e93ee Mon Sep 17 00:00:00 2001 From: Fabiano Weimar Date: Sat, 30 Nov 2024 14:33:23 +0000 Subject: [PATCH 2/3] Add missing comma. --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2795526db9..dfe708c4a9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/python { "name": "Plone 6.1", - "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye" + "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye", // Use 'portsAttributes' to set default properties for specific forwarded ports. // More info: https://containers.dev/implementors/json_reference/#port-attributes From cccaf61d53a33354d0a6c1d5e30d68b21a273c77 Mon Sep 17 00:00:00 2001 From: Fabiano Weimar Date: Sat, 30 Nov 2024 12:20:28 -0300 Subject: [PATCH 3/3] Add plone build to the dev container. --- .devcontainer/devcontainer-build.sh | 5 +++++ .devcontainer/devcontainer.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 .devcontainer/devcontainer-build.sh diff --git a/.devcontainer/devcontainer-build.sh b/.devcontainer/devcontainer-build.sh new file mode 100755 index 0000000000..e0755c26c3 --- /dev/null +++ b/.devcontainer/devcontainer-build.sh @@ -0,0 +1,5 @@ +#/bin/sh +`which python3.12` -m venv . +./bin/pip install -r requirements.txt +./bin/buildout +echo "run plone with: ./bin/instance fg" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index dfe708c4a9..11368063c7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,5 +14,5 @@ }, // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt" + "postCreateCommand": "./.devcontainer/devcontainer-build.sh" }