зеркало из https://github.com/Azure/benchpress.git
Merge pull request #18 from Azure/aka/dev-container
Add files for dev container
This commit is contained in:
Коммит
8c78a1c040
|
@ -0,0 +1,5 @@
|
|||
# [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
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"features": [
|
||||
{
|
||||
"id": "azurebicep",
|
||||
"name": "Azure Bicep",
|
||||
"options": {
|
||||
"version": {
|
||||
"type": "string",
|
||||
"default": "latest",
|
||||
"description": "Specify a version of the Azure Bicep CLI"
|
||||
}
|
||||
},
|
||||
"entrypoint": "/usr/installbicep.sh"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "C# (.NET)",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"VARIANT": "6.0",
|
||||
"NODE_VERSION": "none"
|
||||
}
|
||||
},
|
||||
"settings": {},
|
||||
"extensions": [
|
||||
"ms-dotnettools.csharp"
|
||||
],
|
||||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode",
|
||||
"features": {
|
||||
"rchaganti/vsc-devcontainer-features/azurebicep" : {
|
||||
"version": "latest"
|
||||
},
|
||||
"azure-cli": "latest",
|
||||
"powershell": "7.2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
set -a
|
||||
. ./devcontainer-features.env
|
||||
set +a
|
||||
|
||||
if [ ! -z ${_BUILD_ARG_AZUREBICEP} ]; then
|
||||
echo "Activating feature 'Azure Bicep'"
|
||||
|
||||
# Azure Bicep CLI version
|
||||
CLIVERSION=${_BUILD_ARG_AZUREBICEP_VERSION:-"latest"}
|
||||
|
||||
if [ "${CLIVERSION}" = "latest" ]; then
|
||||
CLIURL="https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64"
|
||||
else
|
||||
CLIURL="https://github.com/Azure/bicep/releases/download/${CLIVERSION}/bicep-linux-x64"
|
||||
fi
|
||||
|
||||
sudo tee /usr/installbicep.sh > /dev/null \
|
||||
<< EOF
|
||||
sudo curl -Lo /usr/local/bin/bicep ${CLIURL}
|
||||
sudo chmod +x /usr/local/bin/bicep
|
||||
EOF
|
||||
sudo chmod +x /usr/installbicep.sh
|
||||
fi
|
|
@ -0,0 +1,28 @@
|
|||
name: 'Deploy Features'
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Get tag name
|
||||
id: get_tag_name
|
||||
run: echo "::set-output name=tag::$(echo "${{ github.ref }}" | grep -oP 'refs/tags/\K(.+)')"
|
||||
|
||||
- name: Publish dev container features
|
||||
uses: microsoft/publish-dev-container-features-action@main
|
||||
with:
|
||||
path-to-features: '.'
|
||||
|
||||
- name: Get or Create Release at current tag
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
allowUpdates: true # Lets us upload our own artifact from previous step
|
||||
artifactErrorsFailBuild: true
|
||||
artifacts: './devcontainer-features.tgz'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -348,3 +348,6 @@ MigrationBackup/
|
|||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# VS Code
|
||||
.vscode/
|
Загрузка…
Ссылка в новой задаче