зеркало из https://github.com/Azure/benchpress.git
Dev container to support C#, Python, MegaLinter, Azure CLI, Pester, and VS Code extensions for ARM, Bicep, C#, Python (#20)
* Dev container to support C#, Python, MegaLinter, and VS Code extensions for ARM, Bicep, C#, Python * Adding docs Co-authored-by: Uffaz <uffaz@Uffazs-MacBook-Pro.local>
This commit is contained in:
Родитель
f81bfa708e
Коммит
6848c545e4
|
@ -1,5 +1,3 @@
|
|||
# [Choice] .NET version: 6.0, 5.0, 3.1, 6.0-bullseye, 5.0-bullseye, 3.1-bullseye, 6.0-focal, 5.0-focal, 3.1-focal
|
||||
ARG VARIANT="6.0"
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
|
||||
|
||||
RUN pwsh -command Install-Module -Name Pester -Force -SkipPublisherCheck
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:${VARIANT}
|
||||
|
|
|
@ -1,21 +1,82 @@
|
|||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||
{
|
||||
"name": "C# (.NET)",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"VARIANT": "6.0"
|
||||
}
|
||||
},
|
||||
"settings": {},
|
||||
"extensions": [
|
||||
"ms-dotnettools.csharp"
|
||||
],
|
||||
"remoteUser": "vscode",
|
||||
"features": {
|
||||
"azure-cli": "latest",
|
||||
"powershell": "latest",
|
||||
"kubectl-helm-minikube": "latest",
|
||||
"git": "os-provided",
|
||||
"github-cli": "latest"
|
||||
}
|
||||
"name": "Benchpress development tools including Azure CLI, C# (.NET), MegaLinter, Powershell, Python 3, etc",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"VARIANT": "6.0"
|
||||
}
|
||||
},
|
||||
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
// Configure properties specific to VS Code.
|
||||
"vscode": {
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
// Python
|
||||
"python.defaultInterpreterPath": "/usr/local/python/current/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"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
// ARM tools
|
||||
"msazurermtools.azurerm-vscode-tools",
|
||||
|
||||
// Bicep
|
||||
"ms-azuretools.vscode-bicep",
|
||||
|
||||
// C#
|
||||
"ms-dotnettools.csharp",
|
||||
|
||||
// Python
|
||||
"ms-python.python",
|
||||
"ms-python.vscode-pylance"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// This can be used to network with other containers or with the host.
|
||||
// "forwardPorts": [5432],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// Installs:
|
||||
// 1. Mega Linter
|
||||
// 2. Pester
|
||||
"postCreateCommand": "npm install -g mega-linter-runner && pwsh -command Install-Module -Name Pester -Force -SkipPublisherCheck",
|
||||
|
||||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/azure-cli:1": {
|
||||
"version": "latest"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/powershell:1": {
|
||||
"version": "latest"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/git:1": {
|
||||
"version": "latest"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/github-cli:1": {
|
||||
"version": "latest"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"version": "latest"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/python:1": {
|
||||
"version": "latest"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,9 @@ B --> C[Remove]
|
|||
**Verification**: Test is going to confirm the resource exists and also assert if it matches the expected value
|
||||
**Remove**: Optionally resources can be removed after being tested
|
||||
|
||||
## Getting started
|
||||
See [Getting Started](docs/getting_started.md) guide on how to start development on *Benchpress*.
|
||||
|
||||
## Contributing
|
||||
|
||||
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
# Getting started
|
||||
This guide walks you through the process of starting development on *Benchpress*.
|
||||
|
||||
## Setting up the development environment
|
||||
|
||||
If you’re using [Visual Studio Code](https://code.visualstudio.com/) as your IDE of choice, then this project contains all of the necessary configurations to bootstrap your development environment. See the section on [Development environment setup within VS Code
|
||||
](#development-environment-setup-within-vs-code)
|
||||
|
||||
### Development dependencies
|
||||
Depending on the feature/language you are working on, you may need to download and install language-specific packages, e.g., Python 3.
|
||||
|
||||
List of requirements on development machine:
|
||||
|
||||
- Azure CLI
|
||||
- DotNet Core (version 6.0)
|
||||
- Node (>= version 14)
|
||||
- PowerShell 8
|
||||
- Python 3
|
||||
|
||||
|
||||
### Development environment setup within VS Code
|
||||
Visual Studio Code supports compilation and development on a container known as [Dev Containers](https://code.visualstudio.com/docs/remote/containers).
|
||||
|
||||
If you’re using VS Code, please install see the installation guide to install Docker and VS Code extension: https://code.visualstudio.com/docs/remote/containers#_installation
|
||||
|
||||
Then launch the environment by opening the command pallete <kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux) and running `Dev Containers: Open Folder in Container`
|
||||
|
||||
The Dev Container configuration also contains VS Code extensions for linting/formatting/testing/compilation.
|
Загрузка…
Ссылка в новой задаче