Skip to content

Commit 9725244

Browse files
committed
Initial commit
0 parents  commit 9725244

13 files changed

+1564
-0
lines changed

.cz-config.js

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
module.exports = {
2+
types: [
3+
{ value: "feat", name: "feat: A new feature" },
4+
{ value: "fix", name: "fix: A bug fix" },
5+
{ value: "docs", name: "docs: Documentation only changes" },
6+
{
7+
value: "style",
8+
name: "style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)",
9+
},
10+
{
11+
value: "refactor",
12+
name: "refactor: A code change that neither fixes a bug nor adds a feature",
13+
},
14+
{
15+
value: "perf",
16+
name: "perf: A code change that improves performance",
17+
},
18+
{ value: "test", name: "test: Adding missing tests" },
19+
{
20+
value: "chore",
21+
name: "chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation",
22+
},
23+
{ value: "revert", name: "revert: Revert to a commit" },
24+
{ value: "WIP", name: "WIP: Work in progress" },
25+
],
26+
27+
scopes: [{ name: "infra" }, { name: "ci-cd" }, { name: "your-scope-1" }],
28+
29+
allowTicketNumber: false,
30+
isTicketNumberRequired: false,
31+
ticketNumberPrefix: "TICKET-",
32+
ticketNumberRegExp: "\\d{1,5}",
33+
34+
messages: {
35+
type: "Select the type of change that you're committing:",
36+
scope: "\nDenote the SCOPE of this change (optional):",
37+
// used if allowCustomScopes is true
38+
customScope: "Denote the SCOPE of this change:",
39+
subject: "Write a SHORT, IMPERATIVE tense description of the change:\n",
40+
body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
41+
breaking: "List any BREAKING CHANGES (optional):\n",
42+
footer:
43+
"List any ISSUES CLOSED by this change (optional). E.g.: #31, #34:\n",
44+
confirmCommit: "Are you sure you want to proceed with the commit above?",
45+
},
46+
47+
allowCustomScopes: true,
48+
allowBreakingChanges: ["feat", "fix"],
49+
// skip any questions you want
50+
skipQuestions: ["body", "footer", "breaking"],
51+
52+
// limit subject length
53+
subjectLimit: 100,
54+
// breaklineChar: '|', // It is supported for fields body and footer.
55+
// footerPrefix : 'ISSUES CLOSED:'
56+
// askForBreakingChangeFirst : true, // default is false
57+
};

.devcontainer/Dockerfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/dotnet/.devcontainer/base.Dockerfile
2+
3+
# [Choice] .NET version: 5.0, 3.1, 2.1
4+
ARG VARIANT="5.0"
5+
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
6+
7+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
8+
ARG NODE_VERSION="none"
9+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
10+
11+
# [Option] Install Azure CLI
12+
ARG INSTALL_AZURE_CLI="false"
13+
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/
14+
RUN if [ "$INSTALL_AZURE_CLI" = "true" ]; then bash /tmp/library-scripts/azcli-debian.sh; fi \
15+
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
16+
17+
# Add python3
18+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get install -y software-properties-common gcc \
19+
&& apt-get -y install --no-install-recommends python3.9 python3-doc python3-distutils python3-venv python3-pip python3-apt python3-dev \
20+
&& python3 -m pip install --no-cache-dir --upgrade pip
21+
22+
# Install commitizen as a global node package
23+
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && echo '{ \"path\": \"cz-customizable\" }' > ~/.czrc && npm install -g commitizen cz-customizable" 2>&1

.devcontainer/devcontainer.json

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/dotnet
3+
{
4+
"name": "C# (.NET) with Python3",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1, 5.0
9+
"VARIANT": "5.0",
10+
// Options
11+
"NODE_VERSION": "lts/*",
12+
"INSTALL_AZURE_CLI": "true"
13+
}
14+
},
15+
16+
// Set *default* container specific settings.json values on container create.
17+
"settings": {
18+
"python.languageServer": "Pylance",
19+
"python.linting.enabled": true,
20+
"python.linting.pylintEnabled": true,
21+
"python.formatting.provider": "black",
22+
"editor.formatOnType": true,
23+
"files.trimTrailingWhitespace": true,
24+
},
25+
26+
// Add the IDs of extensions you want installed when the container is created.
27+
"extensions": [
28+
"ms-dotnettools.csharp",
29+
"ms-python.python",
30+
"ms-python.vscode-pylance"
31+
],
32+
33+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
34+
// "forwardPorts": [5000, 5001],
35+
36+
// [Optional] To reuse of your local HTTPS dev cert:
37+
//
38+
// 1. Export it locally using this command:
39+
// * Windows PowerShell:
40+
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
41+
// * macOS/Linux terminal:
42+
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
43+
//
44+
// 2. Uncomment these 'remoteEnv' lines:
45+
// "remoteEnv": {
46+
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
47+
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
48+
// },
49+
//
50+
// 3. Do one of the following depending on your scenario:
51+
// * When using GitHub Codespaces and/or Remote - Containers:
52+
// 1. Start the container
53+
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
54+
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
55+
//
56+
// * If only using Remote - Containers with a local container, uncomment this line instead:
57+
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],
58+
59+
// Use 'postCreateCommand' to run commands after the container is created.
60+
// "postCreateCommand": "dotnet restore",
61+
62+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
63+
"remoteUser": "vscode"
64+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env bash
2+
#-------------------------------------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
5+
#-------------------------------------------------------------------------------------------------------------
6+
#
7+
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/azcli.md
8+
# Maintainer: The VS Code and Codespaces Teams
9+
#
10+
# Syntax: ./azcli-debian.sh
11+
12+
set -e
13+
14+
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
15+
16+
if [ "$(id -u)" -ne 0 ]; then
17+
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
18+
exit 1
19+
fi
20+
21+
# Get central common setting
22+
get_common_setting() {
23+
if [ "${common_settings_file_loaded}" != "true" ]; then
24+
curl -sfL "https://aka.ms/vscode-dev-containers/script-library/settings.env" 2>/dev/null -o /tmp/vsdc-settings.env || echo "Could not download settings file. Skipping."
25+
common_settings_file_loaded=true
26+
fi
27+
if [ -f "/tmp/vsdc-settings.env" ]; then
28+
local multi_line=""
29+
if [ "$2" = "true" ]; then multi_line="-z"; fi
30+
local result="$(grep ${multi_line} -oP "$1=\"?\K[^\"]+" /tmp/vsdc-settings.env | tr -d '\0')"
31+
if [ ! -z "${result}" ]; then declare -g $1="${result}"; fi
32+
fi
33+
echo "$1=${!1}"
34+
}
35+
36+
# Function to run apt-get if needed
37+
apt_get_update_if_needed()
38+
{
39+
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
40+
echo "Running apt-get update..."
41+
apt-get update
42+
else
43+
echo "Skipping apt-get update."
44+
fi
45+
}
46+
47+
# Checks if packages are installed and installs them if not
48+
check_packages() {
49+
if ! dpkg -s "$@" > /dev/null 2>&1; then
50+
apt_get_update_if_needed
51+
apt-get -y install --no-install-recommends "$@"
52+
fi
53+
}
54+
55+
export DEBIAN_FRONTEND=noninteractive
56+
57+
# Install dependencies
58+
check_packages apt-transport-https curl ca-certificates lsb-release gnupg2
59+
60+
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
61+
. /etc/os-release
62+
get_common_setting MICROSOFT_GPG_KEYS_URI
63+
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
64+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-cli.list
65+
apt-get update
66+
apt-get install -y azure-cli
67+
echo "Done!"

0 commit comments

Comments
 (0)