Skip to content

Commit 4252a41

Browse files
authored
refactor: upgrade to .net 8 and refactoring (#227)
1 parent 28727ab commit 4252a41

File tree

976 files changed

+47092
-4274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

976 files changed

+47092
-4274
lines changed

.bash_aliases

+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# This command is used a LOT both below and in daily life
2+
alias k=kubectl
3+
4+
# Execute a kubectl command against all namespaces
5+
alias kca='_kca(){ kubectl "$@" --all-namespaces; unset -f _kca; }; _kca'
6+
7+
# Apply a YML file
8+
alias kaf='kubectl apply -f'
9+
10+
# Drop into an interactive terminal on a container
11+
alias keti='kubectl exec -t -i'
12+
13+
# Manage configuration quickly to switch contexts between local, dev ad staging.
14+
alias kcuc='kubectl config use-context'
15+
alias kcsc='kubectl config set-context'
16+
alias kcdc='kubectl config delete-context'
17+
alias kccc='kubectl config current-context'
18+
19+
# List all contexts
20+
alias kcgc='kubectl config get-contexts'
21+
22+
# General aliases
23+
alias kdel='kubectl delete'
24+
alias kdelf='kubectl delete -f'
25+
26+
# Pod management.
27+
alias kgp='kubectl get pods'
28+
alias kgpa='kubectl get pods --all-namespaces'
29+
alias kgpw='kgp --watch'
30+
alias kgpwide='kgp -o wide'
31+
alias kep='kubectl edit pods'
32+
alias kdp='kubectl describe pods'
33+
alias kdelp='kubectl delete pods'
34+
alias kgpall='kubectl get pods --all-namespaces -o wide'
35+
36+
# get pod by label: kgpl "app=myapp" -n myns
37+
alias kgpl='kgp -l'
38+
39+
# get pod by namespace: kgpn kube-system"
40+
alias kgpn='kgp -n'
41+
42+
# Service management.
43+
alias kgs='kubectl get svc'
44+
alias kgsa='kubectl get svc --all-namespaces'
45+
alias kgsw='kgs --watch'
46+
alias kgswide='kgs -o wide'
47+
alias kes='kubectl edit svc'
48+
alias kds='kubectl describe svc'
49+
alias kdels='kubectl delete svc'
50+
51+
# Ingress management
52+
alias kgi='kubectl get ingress'
53+
alias kgia='kubectl get ingress --all-namespaces'
54+
alias kei='kubectl edit ingress'
55+
alias kdi='kubectl describe ingress'
56+
alias kdeli='kubectl delete ingress'
57+
58+
# Namespace management
59+
alias kgns='kubectl get namespaces'
60+
alias kens='kubectl edit namespace'
61+
alias kdns='kubectl describe namespace'
62+
alias kdelns='kubectl delete namespace'
63+
alias kcn='kubectl config set-context --current --namespace'
64+
65+
# ConfigMap management
66+
alias kgcm='kubectl get configmaps'
67+
alias kgcma='kubectl get configmaps --all-namespaces'
68+
alias kecm='kubectl edit configmap'
69+
alias kdcm='kubectl describe configmap'
70+
alias kdelcm='kubectl delete configmap'
71+
72+
# Secret management
73+
alias kgsec='kubectl get secret'
74+
alias kgseca='kubectl get secret --all-namespaces'
75+
alias kdsec='kubectl describe secret'
76+
alias kdelsec='kubectl delete secret'
77+
78+
# Deployment management.
79+
alias kgd='kubectl get deployment'
80+
alias kgda='kubectl get deployment --all-namespaces'
81+
alias kgdw='kgd --watch'
82+
alias kgdwide='kgd -o wide'
83+
alias ked='kubectl edit deployment'
84+
alias kdd='kubectl describe deployment'
85+
alias kdeld='kubectl delete deployment'
86+
alias ksd='kubectl scale deployment'
87+
alias krsd='kubectl rollout status deployment'
88+
89+
# Rollout management.
90+
alias kgrs='kubectl get replicaset'
91+
alias kdrs='kubectl describe replicaset'
92+
alias kers='kubectl edit replicaset'
93+
alias krh='kubectl rollout history'
94+
alias kru='kubectl rollout undo'
95+
96+
# Statefulset management.
97+
alias kgss='kubectl get statefulset'
98+
alias kgssa='kubectl get statefulset --all-namespaces'
99+
alias kgssw='kgss --watch'
100+
alias kgsswide='kgss -o wide'
101+
alias kess='kubectl edit statefulset'
102+
alias kdss='kubectl describe statefulset'
103+
alias kdelss='kubectl delete statefulset'
104+
alias ksss='kubectl scale statefulset'
105+
alias krsss='kubectl rollout status statefulset'
106+
107+
# Port forwarding
108+
alias kpf="kubectl port-forward"
109+
110+
# Tools for accessing all information
111+
alias kga='kubectl get all'
112+
alias kgaa='kubectl get all --all-namespaces'
113+
114+
# Logs
115+
alias kl='kubectl logs'
116+
alias kl1h='kubectl logs --since 1h'
117+
alias kl1m='kubectl logs --since 1m'
118+
alias kl1s='kubectl logs --since 1s'
119+
alias klf='kubectl logs -f'
120+
alias klf1h='kubectl logs --since 1h -f'
121+
alias klf1m='kubectl logs --since 1m -f'
122+
alias klf1s='kubectl logs --since 1s -f'
123+
124+
# File copy
125+
alias kcp='kubectl cp'
126+
127+
# Node Management
128+
alias kgno='kubectl get nodes'
129+
alias keno='kubectl edit node'
130+
alias kdno='kubectl describe node'
131+
alias kdelno='kubectl delete node'
132+
133+
# PVC management.
134+
alias kgpvc='kubectl get pvc'
135+
alias kgpvca='kubectl get pvc --all-namespaces'
136+
alias kgpvcw='kgpvc --watch'
137+
alias kepvc='kubectl edit pvc'
138+
alias kdpvc='kubectl describe pvc'
139+
alias kdelpvc='kubectl delete pvc'
140+
141+
# Service account management.
142+
alias kdsa="kubectl describe sa"
143+
alias kdelsa="kubectl delete sa"
144+
145+
# DaemonSet management.
146+
alias kgds='kubectl get daemonset'
147+
alias kgdsw='kgds --watch'
148+
alias keds='kubectl edit daemonset'
149+
alias kdds='kubectl describe daemonset'
150+
alias kdelds='kubectl delete daemonset'
151+
152+
# CronJob management.
153+
alias kgcj='kubectl get cronjob'
154+
alias kecj='kubectl edit cronjob'
155+
alias kdcj='kubectl describe cronjob'
156+
alias kdelcj='kubectl delete cronjob'
157+
158+
# Job management.
159+
alias kgj='kubectl get job'
160+
alias kej='kubectl edit job'
161+
alias kdj='kubectl describe job'
162+
alias kdelj='kubectl delete job'

.config/dotnet-tools.json

+38-6
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,60 @@
33
"isRoot": true,
44
"tools": {
55
"altcover.global": {
6-
"version": "8.3.838",
6+
"version": "8.8.74",
77
"commands": [
88
"altcover"
9-
]
9+
],
10+
"rollForward": false
1011
},
1112
"cake.tool": {
1213
"version": "2.3.0",
1314
"commands": [
1415
"dotnet-cake"
15-
]
16+
],
17+
"rollForward": false
1618
},
1719
"dotnet-format": {
1820
"version": "5.1.250801",
1921
"commands": [
2022
"dotnet-format"
21-
]
23+
],
24+
"rollForward": false
2225
},
2326
"csharpier": {
24-
"version": "0.22.1",
27+
"version": "0.28.2",
2528
"commands": [
2629
"dotnet-csharpier"
27-
]
30+
],
31+
"rollForward": false
32+
},
33+
"swashbuckle.aspnetcore.cli": {
34+
"version": "6.6.2",
35+
"commands": [
36+
"swagger"
37+
],
38+
"rollForward": false
39+
},
40+
"microsoft.tye": {
41+
"version": "0.11.0-alpha.22111.1",
42+
"commands": [
43+
"tye"
44+
],
45+
"rollForward": false
46+
},
47+
"dotnet-ef": {
48+
"version": "8.0.7",
49+
"commands": [
50+
"dotnet-ef"
51+
],
52+
"rollForward": false
53+
},
54+
"dotnet-outdated-tool": {
55+
"version": "4.6.4",
56+
"commands": [
57+
"dotnet-outdated"
58+
],
59+
"rollForward": false
2860
}
2961
}
3062
}

.devcontainer/Dockerfile

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/ubuntu/.devcontainer/base.Dockerfile
2-
# https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/ubuntu/.devcontainer
3-
# https://github.com/devcontainers/images/tree/main/src/dotnet
1+
# https://containers.dev/guide/dockerfile#dockerfile
42

5-
# Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
6-
# Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
7-
ARG VARIANT="jammy"
8-
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
3+
FROM mcr.microsoft.com/devcontainers/dotnet:latest
4+
5+
# Add additional commands

.devcontainer/devcontainer.json

+112-35
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,113 @@
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.245.0/containers/ubuntu
3-
// https://github.com/microsoft/vscode-remote-try-dotnetcore/blob/main/.devcontainer/devcontainer.json
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
3+
// https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/setting-up-your-dotnet-project-for-codespaces
4+
// https://github.com/microsoft/vscode-remote-try-dotnet
5+
// https://dev.to/this-is-learning/set-up-github-codespaces-for-a-net-8-application-5999
6+
// https://audacioustux.notion.site/Getting-Started-with-Devcontainer-c727dbf9d56f4d6b9b0ef87b3111693f
47
{
5-
"name": "Ubuntu",
6-
"build": {
7-
"dockerfile": "Dockerfile",
8-
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
9-
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
10-
"args": {
11-
"VARIANT": "ubuntu-22.04"
12-
}
13-
},
14-
"extensions": [
15-
"ms-dotnettools.csharp",
16-
"mutantdino.resourcemonitor",
17-
"humao.rest-client",
18-
"dzhavat.bracket-pair-toggler",
19-
"Trottero.dotnetwatchattach",
20-
"ms-azuretools.vscode-docker",
21-
"vivaxy.vscode-conventional-commits",
22-
"emmanuelbeziat.vscode-great-icons",
23-
"fernandoescolar.vscode-solution-explorer",
24-
"mikestead.dotenv",
25-
"ms-vscode.vs-keybindings"
26-
],
27-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
28-
// "forwardPorts": [],
29-
// Use 'postCreateCommand' to run commands after the container is created.
30-
"postCreateCommand": "uname -a",
31-
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
32-
"remoteUser": "vscode",
33-
"features": {
34-
"docker-in-docker": "latest"
35-
}
36-
}
8+
"name": "Food Delivery Microservices",
9+
// use existing dev container templates. More info: https://containers.dev/guide/dockerfile, https://containers.dev/templates
10+
//"image": "mcr.microsoft.com/devcontainers/dotnet:1-7.0",
11+
// use a Dockerfile file. More info: https://containers.dev/guide/dockerfile#dockerfile
12+
// "build": {
13+
// // Path is relative to the devcontainer.json file.
14+
// "dockerfile": "Dockerfile"
15+
// },
16+
// using a Dockerfile with Docker Compose, https://containers.dev/guide/dockerfile#docker-compose-image
17+
"dockerComposeFile": "docker-compose.yaml",
18+
"service": "devcontainer",
19+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
20+
// Features to add to the dev container. More info: https://containers.dev/features.
21+
"features": {
22+
// https://github.com/devcontainers/features/tree/main/src/dotnet#dotnet-cli-dotnet
23+
"ghcr.io/devcontainers/features/dotnet:2": {
24+
// this version should be matched with global.json .net version for working vscode IntelliSense correctly
25+
"version": "8.0.303",
26+
"additionalVersions": "latest, 7.0.410, 8.0.303, 6.0.424",
27+
"aspNetCoreRuntimeVersions": "latest, 7.0"
28+
},
29+
// https://github.com/devcontainers/features/tree/main/src/github-cli
30+
"ghcr.io/devcontainers/features/github-cli:1": {
31+
"version": "2"
32+
},
33+
// https://github.com/devcontainers/features/tree/main/src/powershell
34+
"ghcr.io/devcontainers/features/powershell:1": {
35+
"version": "latest"
36+
},
37+
// https://github.com/devcontainers/features/tree/main/src/node
38+
"ghcr.io/devcontainers/features/node:1": {},
39+
// // https://github.com/devcontainers/features/tree/main/src/kubectl-helm-minikube
40+
// "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {},
41+
// // https://github.com/devcontainers/features/tree/main/src/terraform
42+
// "ghcr.io/devcontainers/features/terraform:1": {},
43+
// https://github.com/devcontainers/features/tree/main/src/docker-in-docker
44+
// https://devopscube.com/run-docker-in-docker/
45+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
46+
"dockerDashComposeVersion": "v2"
47+
},
48+
"ghcr.io/devcontainers/features/git:1": {},
49+
// https://github.com/devcontainers/features/tree/main/src/common-utils
50+
"ghcr.io/devcontainers/features/common-utils:2": {
51+
"configureZshAsDefaultShell": true
52+
}
53+
},
54+
// Configure tool-specific properties.
55+
"customizations": {
56+
// Configure properties specific to VS Code.
57+
"vscode": {
58+
"settings": {
59+
"git.autofetch": true,
60+
"files.autoSave": "onFocusChange",
61+
"editor.formatOnSave": true,
62+
"editor.suggest.snippetsPreventQuickSuggestions": false,
63+
"explorer.autoReveal": true,
64+
"resmon.show.cpufreq": false,
65+
"dotnet.defaultSolution": "food-delivery.sln",
66+
"dotnet.server.startTimeout": 60000,
67+
"omnisharp.projectLoadTimeout": 60,
68+
"workbench.colorTheme": "Visual Studio Light",
69+
"workbench.iconTheme": "material-icon-theme",
70+
"editor.minimap.enabled": false,
71+
"editor.fontFamily": "'MesloLGM Nerd Font', 'Droid Sans Mono', 'monospace', 'Droid Sans Fallback', 'Consolas'",
72+
"editor.fontSize": 14,
73+
"explorer.confirmDelete": false,
74+
"terminal.integrated.defaultProfile.windows": "PowerShell",
75+
"terminal.integrated.defaultProfile.linux": "zsh",
76+
"powershell.cwd": "~",
77+
"terminal.external.windowsExec": "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\pwsh.exe"
78+
},
79+
"extensions": [
80+
"streetsidesoftware.code-spell-checker",
81+
"ms-dotnettools.csdevkit",
82+
"mutantdino.resourcemonitor",
83+
"humao.rest-client",
84+
"dzhavat.bracket-pair-toggler",
85+
"ms-azuretools.vscode-docker",
86+
"vivaxy.vscode-conventional-commits",
87+
"emmanuelbeziat.vscode-great-icons",
88+
"ms-vscode.vs-keybindings",
89+
"GitHub.vscode-github-actions",
90+
"PKief.material-icon-theme",
91+
"EditorConfig.EditorConfig",
92+
"DavidAnson.vscode-markdownlint"
93+
]
94+
}
95+
},
96+
"hostRequirements": {
97+
"cpus": 2,
98+
"memory": "8gb",
99+
"storage": "32gb"
100+
},
101+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
102+
// "forwardPorts": [5000, 5001],
103+
// "portsAttributes": {
104+
// "5001": {
105+
// "protocol": "https"
106+
// }
107+
// }
108+
// https://containers.dev/implementors/json_reference/#lifecycle-scripts
109+
"updateContentCommand": "chmod +x .devcontainer/scripts/update.sh",
110+
"postCreateCommand": "chmod +x .devcontainer/scripts/post-create.sh"
111+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
112+
// "remoteUser": "root"
113+
}

0 commit comments

Comments
 (0)