From 338c1ab6f6e5385025a25cd3670f875453671289 Mon Sep 17 00:00:00 2001 From: Ion Date: Thu, 14 Mar 2024 20:44:07 +0000 Subject: [PATCH] update devcontainer configuration --- .devcontainer/configure.sh | 13 +++++++++++++ .devcontainer/devcontainer.json | 7 ++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .devcontainer/configure.sh diff --git a/.devcontainer/configure.sh b/.devcontainer/configure.sh new file mode 100644 index 0000000..0cb7b42 --- /dev/null +++ b/.devcontainer/configure.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "Configuring the dev environment..." + +# git credentials and keys +git config --global user.name "$DEV_NAME" +git config --global user.email "$DEV_EMAIL" +chmod 600 /root/.ssh/id_rsa + +# testpypi +poetry config pypi-token.testpypi "$TEST_PYPI_TOKEN" + +echo "Done." \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d03e212..150b3b5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,13 +9,14 @@ "--network=host", "-e", "DEV_NAME=${localEnv:DEV_NAME}", "-e", "DEV_EMAIL=${localEnv:DEV_EMAIL}", - "-e", "FIREDUST_API_KEY=${localEnv:FIREDUST_API_KEY}" + "-e", "FIREDUST_API_KEY=${localEnv:FIREDUST_API_KEY}", + "-e", "TEST_PYPI_TOKEN=${localEnv:TEST_PYPI_TOKEN}" ], "mounts": [ // ---------------------------------------- // SSH keys // mac ssh keys - "source=/Users/$(whoami)/.ssh,target=/root/.ssh,type=bind,consistency=cached", + "source=/Users/${localEnv:USER_NAME}/.ssh,target=/root/.ssh,type=bind,consistency=cached", // linux ssh keys // "source=/home/$(whoami)/.ssh,target=/root/.ssh,type=bind,consistency=cached", // windows ssh keys @@ -23,7 +24,7 @@ // TODO: comment out the lines for the OS you are not using // ---------------------------------------- ], - "postCreateCommand": "git config --global user.name $DEV_NAME && git config --global user.email $DEV_EMAIL && chmod 600 /root/.ssh/id_rsa", + "postCreateCommand": "bash .devcontainer/configure.sh", "customizations": { "vscode": { "extensions": [