Skip to content

Commit

Permalink
Try codespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
fhammerl committed Sep 5, 2022
1 parent 49e808a commit 24b087d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 29 deletions.
8 changes: 8 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM mcr.microsoft.com/vscode/devcontainers/universal

RUN cd /tmp && wget https://download.visualstudio.microsoft.com/download/pr/dc930bff-ef3d-4f6f-8799-6eb60390f5b4/1efee2a8ea0180c94aff8f15eb3af981/dotnet-sdk-6.0.300-linux-x64.tar.gz
RUN mkdir -p $HOME/dotnet && tar zxf /tmp/dotnet-sdk-6.0.300-linux-x64.tar.gz -C $HOME/dotnet
RUN rm /tmp/dotnet-sdk-6.0.300-linux-x64.tar.gz

ENV DOTNET_ROOT="$HOME/dotnet"
ENV PATH="$PATH:$HOME/dotnet"
62 changes: 42 additions & 20 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,54 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.224.2/containers/codespaces-linux
{
"name": "GitHub Codespaces (Default)",
"settings": {
"files.watcherExclude": {
"**/_layout/**": true
"name": "Runner Codespaces",
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"python.defaultInterpreterPath": "/opt/python/latest/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
"lldb.executable": "/usr/bin/lldb",
"files.watcherExclude": {
"**/_layout/**": true
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"GitHub.vscode-pull-request-github"
]
}
},
"remoteUser": "codespace",
"remoteUser": "root",
"overrideCommand": false,
"mounts": ["source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume"],
"mounts": [
"source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume"
],
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",
"--privileged",
"--init"
],

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"GitHub.vscode-pull-request-github",
"ms-dotnettools.csharp",
"eamodio.gitlens"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

"postCreateCommand": "bash .devcontainer/init.sh"
}
// "extensions": [
// "GitHub.vscode-pull-request-github",
// "ms-dotnettools.csharp",
// "eamodio.gitlens"
// ],
// "postCreateCommand": "bash .devcontainer/init.sh"
}
15 changes: 6 additions & 9 deletions .devcontainer/init.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
### Create _dotnetsdk
echo 'Creating symlink for embedded sdk...'
ln -s /home/codespace/.dotnet/sdk/ _dotnetsdk

# pwd is the source root folder
ln -s /home/root/.dotnet/sdk/ _dotnetsdk
echo .6.0.300 >> _dotnetsdk/6.0.300/.6.0.300
ln -s /home/codespace/.dotnet/dotnet _dotnetsdk/6.0.300/dotnet
ln -s /home/root/.dotnet/dotnet _dotnetsdk/6.0.300/dotnet

### Restore
dotnet restore src/Runner.Listener &
dotnet restore src/Runner.Common &
dotnet restore src/Runner.Sdk &
dotnet restore src/Runner.Worker &
dotnet restore src/Test &
cd src
./dev.sh

0 comments on commit 24b087d

Please sign in to comment.