diff options
author | Eric Erhardt <eric.erhardt@microsoft.com> | 2021-11-09 05:18:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-09 05:18:05 +0300 |
commit | 3dfdcb918b515e130f6dc69335886d7685612db9 (patch) | |
tree | cd500c748e8edec2003710d846a4639992426c04 /.devcontainer | |
parent | 07970383a82834122e12165feb64e732c18de264 (diff) |
Add instructions for using Codespaces (#60996)
* Add instructions for using Codespaces
* Automate resetting the HEAD to the same commit ID used to build the pre-built container
* - Add notes about testing changes.
- Add 4-core machines
* Revert 4-core change since prebuild doesn't support multiple sku_names.
Diffstat (limited to '.devcontainer')
-rw-r--r-- | .devcontainer/devcontainer.json | 3 | ||||
-rwxr-xr-x | .devcontainer/scripts/onCreateCommand.sh | 3 | ||||
-rwxr-xr-x | .devcontainer/scripts/postCreateCommand.sh | 6 |
3 files changed, 12 insertions, 0 deletions
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b3dfd99aebd..baf0b306f73 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -23,6 +23,9 @@ // Use 'onCreateCommand' to run pre-build commands inside the codespace "onCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/onCreateCommand.sh", + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/postCreateCommand.sh", + // Add the locally installed dotnet to the path to ensure that it is activated // This allows developers to just use 'dotnet build' on the command-line, and the local dotnet version will be used. "remoteEnv": { diff --git a/.devcontainer/scripts/onCreateCommand.sh b/.devcontainer/scripts/onCreateCommand.sh index dc0154c619b..983db183068 100755 --- a/.devcontainer/scripts/onCreateCommand.sh +++ b/.devcontainer/scripts/onCreateCommand.sh @@ -4,3 +4,6 @@ set -e # prebuild the repo, so it is ready for development ./build.sh libs+clr -rc Release + +# save the commit hash of the currently built assemblies, so developers know which version was built +git rev-parse HEAD > ./artifacts/prebuild.sha diff --git a/.devcontainer/scripts/postCreateCommand.sh b/.devcontainer/scripts/postCreateCommand.sh new file mode 100755 index 00000000000..8086037ab9a --- /dev/null +++ b/.devcontainer/scripts/postCreateCommand.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -e + +# reset the repo to the commit hash that was used to build the prebuilt Codespace +git reset --hard $(cat ./artifacts/prebuild.sha) |