From 9c903f1b0107343786498aa47f4027eddb16cc40 Mon Sep 17 00:00:00 2001 From: nick Date: Wed, 27 Oct 2021 20:42:03 +0000 Subject: [PATCH] misc: improve devcontainer environment setup - Legacy-Id: 19481 --- .devcontainer/devcontainer.json | 5 +++-- .devcontainer/docker-compose.yml | 1 + .devcontainer/init.sh | 4 +++- .vscode/settings.json | 11 ----------- 4 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7574cbc0e..88fa4bccc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,6 +10,7 @@ // Set *default* container specific settings.json values on container create. "settings": { + "terminal.integrated.defaultProfile.linux": "zsh", "python.pythonPath": "/usr/local/bin/python", "python.languageServer": "Pylance", "python.linting.enabled": true, @@ -35,6 +36,7 @@ "-p", "test*.py" ] + // "python.envFile": "${workspaceFolder}/.devcontainer/dev.env" }, // Add the IDs of extensions you want installed when the container is created. @@ -46,11 +48,10 @@ "redhat.vscode-yaml", "visualstudioexptteam.vscodeintellicode", "batisteo.vscode-django", - "littlefoxteam.vscode-python-test-adapter" ], // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [8000, 3306], + "forwardPorts": [8000, 3306] // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "sh /docker-init.sh", diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 1cdb8413f..9661ec999 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -29,6 +29,7 @@ services: UID: 1001 GID: 1001 DATADIR: data + # DJANGO_SETTINGS_MODULE: settings_sqlitetest # Uncomment the next line to use a non-root user for all processes. # user: vscode diff --git a/.devcontainer/init.sh b/.devcontainer/init.sh index 0faed96ab..9c9e4185f 100755 --- a/.devcontainer/init.sh +++ b/.devcontainer/init.sh @@ -75,7 +75,7 @@ if [ ! -f $VIRTDIR/bin/activate ]; then # datatracker virtual python environment on docker container entry: " >> /etc/bash.bashrc cat $VIRTDIR/bin/activate >> /etc/bash.bashrc - cat /usr/local/share/datatracker/setprompt >> /etc/bash.bashrc + cat /usr/local/share/datatracker/docker/setprompt >> /etc/bash.bashrc else echo "Using virtual environment at $VIRTDIR" fi @@ -151,6 +151,8 @@ fi HOME=/opt/home/$USER +/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py check --settings=settings_local + # su -p $USER exec "$@" \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 3e5e7f8dd..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "python.testing.unittestArgs": [ - "-v", - "-s", - "./ietf", - "-p", - "test*.py" - ], - "python.testing.pytestEnabled": false, - "python.testing.unittestEnabled": true -} \ No newline at end of file