Skip to content

Commit fbf89f8

Browse files
committed
1st devspaces test
1 parent 9351fb3 commit fbf89f8

15 files changed

Lines changed: 406 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM microsoft/dotnet:2.1-sdk
2+
ENV ASPNETCORE_ENVIRONMENT=Development
3+
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
4+
5+
EXPOSE 80
6+
7+
WORKDIR /src
8+
COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"]
9+
COPY ["src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj", "src/ApiGateways/Mobile.Bff.Shopping/aggregator/"]
10+
11+
RUN dotnet restore -nowarn:msb3202,nu1503
12+
COPY . .
13+
WORKDIR "/src/src/ApiGateways/Mobile.Bff.Shopping/aggregator"
14+
RUN dotnet build "Mobile.Shopping.HttpAggregator.csproj"
15+
16+
CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"]

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
"ASPNETCORE_ENVIRONMENT": "Development"
2525
},
2626
"applicationUrl": "http://localhost:61632/"
27+
},
28+
"Azure Dev Spaces": {
29+
"commandName": "AzureDevSpaces",
30+
"launchBrowser": true,
31+
"resourceGroup": "eshoptestedu",
32+
"aksName": "eshoptestedu",
33+
"subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759"
2734
}
2835
}
2936
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
kind: helm-release
2+
apiVersion: 1.0
3+
build:
4+
context: ..\..\..\..
5+
dockerfile: Dockerfile
6+
install:
7+
chart: charts/aggregator
8+
values:
9+
- values.dev.yaml?
10+
- secrets.dev.yaml?
11+
set:
12+
image:
13+
tag: $(tag)
14+
pullPolicy: Never
15+
disableProbes: true
16+
ingress:
17+
hosts:
18+
# This expands to [space.s.]aggregator.<guid>.<region>.aksapp.io
19+
- $(spacePrefix)aggregator$(hostSuffix)
20+
configurations:
21+
develop:
22+
build:
23+
dockerfile: Dockerfile.develop
24+
useGitIgnore: true
25+
container:
26+
syncTarget: /src
27+
sync:
28+
- "**/Pages/**"
29+
- "**/Views/**"
30+
- "**/wwwroot/**"
31+
- "!**/*.{sln,csproj}"
32+
command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${Configuration:-Debug}"]
33+
iterate:
34+
processesToKill: [dotnet, vsdbg]
35+
buildCommands:
36+
- [dotnet, build, --no-restore, -c, "${Configuration:-Debug}"]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM microsoft/dotnet:2.1-sdk
2+
ENV ASPNETCORE_ENVIRONMENT=Development
3+
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
4+
5+
EXPOSE 80
6+
7+
WORKDIR /src
8+
COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"]
9+
COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"]
10+
COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"]
11+
COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"]
12+
COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"]
13+
COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"]
14+
COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/"]
15+
COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"]
16+
COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"]
17+
COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"]
18+
COPY ["src/Services/Catalog/Catalog.API/Catalog.API.csproj", "src/Services/Catalog/Catalog.API/"]
19+
20+
RUN dotnet restore -nowarn:msb3202,nu1503
21+
COPY . .
22+
WORKDIR "/src/src/Services/Catalog/Catalog.API"
23+
RUN dotnet build "Catalog.API.csproj"
24+
25+
CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"]

src/Services/Catalog/Catalog.API/Properties/launchSettings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
"environmentVariables": {
2424
"ASPNETCORE_ENVIRONMENT": "Development"
2525
}
26+
},
27+
"Azure Dev Spaces": {
28+
"commandName": "AzureDevSpaces",
29+
"launchBrowser": true,
30+
"resourceGroup": "eshoptestedu",
31+
"aksName": "eshoptestedu",
32+
"subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759"
2633
}
2734
}
2835
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
kind: helm-release
2+
apiVersion: 1.0
3+
build:
4+
context: ..\..\..\..
5+
dockerfile: Dockerfile
6+
install:
7+
chart: charts/catalogapi
8+
values:
9+
- values.dev.yaml?
10+
- secrets.dev.yaml?
11+
set:
12+
image:
13+
tag: $(tag)
14+
pullPolicy: Never
15+
disableProbes: true
16+
ingress:
17+
hosts:
18+
# This expands to [space.s.]catalogapi.<guid>.<region>.aksapp.io
19+
- $(spacePrefix)catalogapi$(hostSuffix)
20+
configurations:
21+
develop:
22+
build:
23+
dockerfile: Dockerfile.develop
24+
useGitIgnore: true
25+
container:
26+
syncTarget: /src
27+
sync:
28+
- "**/Pages/**"
29+
- "**/Views/**"
30+
- "**/wwwroot/**"
31+
- "!**/*.{sln,csproj}"
32+
command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${Configuration:-Debug}"]
33+
iterate:
34+
processesToKill: [dotnet, vsdbg]
35+
buildCommands:
36+
- [dotnet, build, --no-restore, -c, "${Configuration:-Debug}"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v1
2+
appVersion: "1.0"
3+
description: A Helm chart for Kubernetes
4+
name: catalogapi
5+
version: 0.1.0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range .Values.ingress.hosts }}
4+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
5+
{{- end }}
6+
{{- else if contains "NodePort" .Values.service.type }}
7+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "catalogapi.fullname" . }})
8+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
9+
echo http://$NODE_IP:$NODE_PORT
10+
{{- else if contains "LoadBalancer" .Values.service.type }}
11+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
12+
You can watch the status of by running 'kubectl get svc -w {{ template "catalogapi.fullname" . }}'
13+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "catalogapi.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
14+
echo http://$SERVICE_IP:{{ .Values.service.port }}
15+
{{- else if contains "ClusterIP" .Values.service.type }}
16+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "catalogapi.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
17+
echo "Visit http://127.0.0.1:8080 to use your application"
18+
kubectl port-forward $POD_NAME 8080:80
19+
{{- end }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "catalogapi.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "catalogapi.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "catalogapi.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}

0 commit comments

Comments
 (0)