From fbf89f8fc77c039eeef952a4b651948933894934 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Tue, 17 Jul 2018 11:04:29 +0200 Subject: [PATCH 01/44] 1st devspaces test --- .../aggregator/Dockerfile.develop | 16 +++++ .../aggregator/Properties/launchSettings.json | 7 ++ .../Mobile.Bff.Shopping/aggregator/azds.yaml | 36 ++++++++++ .../Catalog/Catalog.API/Dockerfile.develop | 25 +++++++ .../Properties/launchSettings.json | 7 ++ src/Services/Catalog/Catalog.API/azds.yaml | 36 ++++++++++ .../Catalog.API/charts/catalogapi/.helmignore | 21 ++++++ .../Catalog.API/charts/catalogapi/Chart.yaml | 5 ++ .../charts/catalogapi/templates/NOTES.txt | 19 +++++ .../charts/catalogapi/templates/_helpers.tpl | 32 +++++++++ .../catalogapi/templates/deployment.yaml | 72 +++++++++++++++++++ .../charts/catalogapi/templates/ingress.yaml | 39 ++++++++++ .../charts/catalogapi/templates/secrets.yaml | 12 ++++ .../charts/catalogapi/templates/service.yaml | 19 +++++ .../Catalog.API/charts/catalogapi/values.yaml | 60 ++++++++++++++++ 15 files changed, 406 insertions(+) create mode 100644 src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop create mode 100644 src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml create mode 100644 src/Services/Catalog/Catalog.API/Dockerfile.develop create mode 100644 src/Services/Catalog/Catalog.API/azds.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop new file mode 100644 index 000000000..e34f6ac1d --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -0,0 +1,16 @@ +FROM microsoft/dotnet:2.1-sdk +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true + +EXPOSE 80 + +WORKDIR /src +COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"] +COPY ["src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj", "src/ApiGateways/Mobile.Bff.Shopping/aggregator/"] + +RUN dotnet restore -nowarn:msb3202,nu1503 +COPY . . +WORKDIR "/src/src/ApiGateways/Mobile.Bff.Shopping/aggregator" +RUN dotnet build "Mobile.Shopping.HttpAggregator.csproj" + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json index 925e70b0d..c259d5094 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json @@ -24,6 +24,13 @@ "ASPNETCORE_ENVIRONMENT": "Development" }, "applicationUrl": "http://localhost:61632/" + }, + "Azure Dev Spaces": { + "commandName": "AzureDevSpaces", + "launchBrowser": true, + "resourceGroup": "eshoptestedu", + "aksName": "eshoptestedu", + "subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759" } } } \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml new file mode 100644 index 000000000..dca11afbf --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml @@ -0,0 +1,36 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: charts/aggregator + values: + - values.dev.yaml? + - secrets.dev.yaml? + set: + image: + tag: $(tag) + pullPolicy: Never + disableProbes: true + ingress: + hosts: + # This expands to [space.s.]aggregator...aksapp.io + - $(spacePrefix)aggregator$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + container: + syncTarget: /src + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${Configuration:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${Configuration:-Debug}"] diff --git a/src/Services/Catalog/Catalog.API/Dockerfile.develop b/src/Services/Catalog/Catalog.API/Dockerfile.develop new file mode 100644 index 000000000..b9ec5f171 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/Dockerfile.develop @@ -0,0 +1,25 @@ +FROM microsoft/dotnet:2.1-sdk +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true + +EXPOSE 80 + +WORKDIR /src +COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"] +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +COPY ["src/Services/Catalog/Catalog.API/Catalog.API.csproj", "src/Services/Catalog/Catalog.API/"] + +RUN dotnet restore -nowarn:msb3202,nu1503 +COPY . . +WORKDIR "/src/src/Services/Catalog/Catalog.API" +RUN dotnet build "Catalog.API.csproj" + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json index 2b21ca280..f5e2b7149 100644 --- a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json +++ b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json @@ -23,6 +23,13 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Azure Dev Spaces": { + "commandName": "AzureDevSpaces", + "launchBrowser": true, + "resourceGroup": "eshoptestedu", + "aksName": "eshoptestedu", + "subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759" } } } \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/azds.yaml b/src/Services/Catalog/Catalog.API/azds.yaml new file mode 100644 index 000000000..34397b646 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/azds.yaml @@ -0,0 +1,36 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: charts/catalogapi + values: + - values.dev.yaml? + - secrets.dev.yaml? + set: + image: + tag: $(tag) + pullPolicy: Never + disableProbes: true + ingress: + hosts: + # This expands to [space.s.]catalogapi...aksapp.io + - $(spacePrefix)catalogapi$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + container: + syncTarget: /src + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${Configuration:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${Configuration:-Debug}"] diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore b/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore new file mode 100644 index 000000000..f0c131944 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml new file mode 100644 index 000000000..1c221148d --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for Kubernetes +name: catalogapi +version: 0.1.0 diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt new file mode 100644 index 000000000..ed8159763 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "catalogapi.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ template "catalogapi.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "catalogapi.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "catalogapi.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl new file mode 100644 index 000000000..908f9d8a3 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "catalogapi.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "catalogapi.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "catalogapi.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml new file mode 100644 index 000000000..1b3777856 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: {{ template "catalogapi.fullname" . }} + labels: + app: {{ template "catalogapi.name" . }} + chart: {{ template "catalogapi.chart" . }} + draft: {{ default "draft-app" .Values.draft }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ template "catalogapi.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "catalogapi.name" . }} + draft: {{ default "draft-app" .Values.draft }} + release: {{ .Release.Name }} + annotations: + buildID: {{ .Values.buildID }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + {{- if not .Values.disableProbes }} + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- $root := . }} + {{- range $ref, $values := .Values.secrets }} + {{- range $key, $value := $values }} + - name: {{ $ref }}_{{ $key }} + valueFrom: + secretKeyRef: + name: {{ template "catalogapi.fullname" $root }}-{{ $ref | lower }} + key: {{ $key }} + {{- end }} + {{- end }} + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml new file mode 100644 index 000000000..b52fc0f37 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "catalogapi.fullname" . -}} +{{- $servicePort := .Values.service.port -}} +{{- $ingressPath := .Values.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ template "catalogapi.name" . }} + chart: {{ template "catalogapi.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml new file mode 100644 index 000000000..e13fb46d3 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml @@ -0,0 +1,12 @@ +{{- $root := . }} +{{- range $name, $values := .Values.secrets }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "catalogapi.fullname" $root }}-{{ $name | lower }} +data: + {{- range $key, $value := $values }} + {{ $key }}: {{ $value | b64enc }} + {{- end }} +--- +{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml new file mode 100644 index 000000000..1c3572dec --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "catalogapi.fullname" . }} + labels: + app: {{ template "catalogapi.name" . }} + chart: {{ template "catalogapi.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ template "catalogapi.name" . }} + release: {{ .Release.Name }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml new file mode 100644 index 000000000..5159ffa6e --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml @@ -0,0 +1,60 @@ +# Default values for catalogapi. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +fullnameOverride: catalogapi +replicaCount: 1 +image: + repository: catalogapi + tag: stable + pullPolicy: IfNotPresent +imagePullSecrets: [] + # Optionally specify an array of imagePullSecrets. + # Secrets must be manually created in the namespace. + # ref: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod + # + # This uses credentials from secret "myRegistryKeySecretName". + # - name: myRegistryKeySecretName +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + annotations: + kubernetes.io/ingress.class: addon-http-application-routing + # kubernetes.io/tls-acme: "true" + path: / + # hosts: + # - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local +secrets: {} + # Optionally specify a set of secret objects whose values + # will be injected as environment variables by default. + # You should add this section to a file like secrets.yaml + # that is explicitly NOT committed to source code control + # and then include it as part of your helm install step. + # ref: https://kubernetes.io/docs/concepts/configuration/secret/ + # + # This creates a secret "mysecret" and injects "mypassword" + # as the environment variable mysecret_mypassword=password. + # mysecret: + # mypassword: password +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi +nodeSelector: {} + +tolerations: [] + +affinity: {} \ No newline at end of file From 91d06af314be6f57dcc4cae16ce1a65d6506db0f Mon Sep 17 00:00:00 2001 From: eiximenis Date: Tue, 31 Jul 2018 17:22:27 +0200 Subject: [PATCH 02/44] starting deploys to devspaces --- src/Services/Basket/Basket.API/.dockerignore | 14 ++++ .../Basket/Basket.API/Dockerfile.develop | 21 ++++++ src/Services/Basket/Basket.API/app.yaml | 43 +++++++++++ src/Services/Basket/Basket.API/azds.yaml | 39 ++++++++++ src/Services/Basket/Basket.API/inf.yaml | 18 +++++ .../Catalog/Catalog.API/Dockerfile.develop | 2 +- .../Properties/launchSettings.json | 4 +- src/Services/Catalog/Catalog.API/app.yaml | 39 ++++++++++ src/Services/Catalog/Catalog.API/azds.yaml | 9 ++- .../Catalog.API/charts/catalogapi/.helmignore | 21 ------ .../Catalog.API/charts/catalogapi/Chart.yaml | 5 -- .../charts/catalogapi/templates/NOTES.txt | 19 ----- .../charts/catalogapi/templates/_helpers.tpl | 32 --------- .../catalogapi/templates/deployment.yaml | 72 ------------------- .../charts/catalogapi/templates/ingress.yaml | 39 ---------- .../charts/catalogapi/templates/secrets.yaml | 12 ---- .../charts/catalogapi/templates/service.yaml | 19 ----- .../Catalog.API/charts/catalogapi/values.yaml | 60 ---------------- src/Services/Catalog/Catalog.API/inf.yaml | 25 +++++++ .../Identity/Identity.API/.dockerignore | 14 ++++ .../Identity/Identity.API/Dockerfile.develop | 17 +++++ src/Services/Identity/Identity.API/app.yaml | 39 ++++++++++ src/Services/Identity/Identity.API/azds.yaml | 42 +++++++++++ src/Services/Identity/Identity.API/inf.yaml | 29 ++++++++ .../Ordering/Ordering.API/.dockerignore | 14 ++++ .../Ordering/Ordering.API/Dockerfile.develop | 26 +++++++ src/Services/Ordering/Ordering.API/app.yaml | 43 +++++++++++ src/Services/Ordering/Ordering.API/azds.yaml | 43 +++++++++++ src/Services/Ordering/Ordering.API/inf.yaml | 22 ++++++ 29 files changed, 498 insertions(+), 284 deletions(-) create mode 100644 src/Services/Basket/Basket.API/.dockerignore create mode 100644 src/Services/Basket/Basket.API/Dockerfile.develop create mode 100644 src/Services/Basket/Basket.API/app.yaml create mode 100644 src/Services/Basket/Basket.API/azds.yaml create mode 100644 src/Services/Basket/Basket.API/inf.yaml create mode 100644 src/Services/Catalog/Catalog.API/app.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml create mode 100644 src/Services/Catalog/Catalog.API/inf.yaml create mode 100644 src/Services/Identity/Identity.API/.dockerignore create mode 100644 src/Services/Identity/Identity.API/Dockerfile.develop create mode 100644 src/Services/Identity/Identity.API/app.yaml create mode 100644 src/Services/Identity/Identity.API/azds.yaml create mode 100644 src/Services/Identity/Identity.API/inf.yaml create mode 100644 src/Services/Ordering/Ordering.API/.dockerignore create mode 100644 src/Services/Ordering/Ordering.API/Dockerfile.develop create mode 100644 src/Services/Ordering/Ordering.API/app.yaml create mode 100644 src/Services/Ordering/Ordering.API/azds.yaml create mode 100644 src/Services/Ordering/Ordering.API/inf.yaml diff --git a/src/Services/Basket/Basket.API/.dockerignore b/src/Services/Basket/Basket.API/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Services/Basket/Basket.API/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/Dockerfile.develop b/src/Services/Basket/Basket.API/Dockerfile.develop new file mode 100644 index 000000000..b7d715b28 --- /dev/null +++ b/src/Services/Basket/Basket.API/Dockerfile.develop @@ -0,0 +1,21 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src + +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +COPY ["src/Services/Basket/Basket.API/Basket.API.csproj", "src/Services/Basket/Basket.API/"] + +RUN dotnet restore src/Services/Basket/Basket.API/Basket.API.csproj -nowarn:msb3202,nu1503 +COPY . . +WORKDIR /src/src/Services/Basket/Basket.API +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/app.yaml b/src/Services/Basket/Basket.API/app.yaml new file mode 100644 index 000000000..6ca5d9d31 --- /dev/null +++ b/src/Services/Basket/Basket.API/app.yaml @@ -0,0 +1,43 @@ +# This heml values file defines app-based settings +# Charts use those values, so this file **MUST** be included in all chart releases + + +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing ap diff --git a/src/Services/Basket/Basket.API/azds.yaml b/src/Services/Basket/Basket.API/azds.yaml new file mode 100644 index 000000000..597c79d8c --- /dev/null +++ b/src/Services/Basket/Basket.API/azds.yaml @@ -0,0 +1,39 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/basket-api + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + hosts: + # This expands to [space.s.]basketapi...aksapp.io + - $(spacePrefix)basketapi$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Services/Basket/Basket.API/inf.yaml b/src/Services/Basket/Basket.API/inf.yaml new file mode 100644 index 000000000..3e3e143da --- /dev/null +++ b/src/Services/Basket/Basket.API/inf.yaml @@ -0,0 +1,18 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + redis: # inf.redis defines the redis' connection strings + basket: + svc: basket-data # Name of k8s svc for basket redis + constr: basket-data # Connection string to Redis used by Basket API + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not diff --git a/src/Services/Catalog/Catalog.API/Dockerfile.develop b/src/Services/Catalog/Catalog.API/Dockerfile.develop index b9ec5f171..b62c7f6e3 100644 --- a/src/Services/Catalog/Catalog.API/Dockerfile.develop +++ b/src/Services/Catalog/Catalog.API/Dockerfile.develop @@ -17,7 +17,7 @@ COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Mic COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] COPY ["src/Services/Catalog/Catalog.API/Catalog.API.csproj", "src/Services/Catalog/Catalog.API/"] -RUN dotnet restore -nowarn:msb3202,nu1503 +RUN dotnet restore src/Services/Catalog/Catalog.API/Catalog.API.csproj -nowarn:msb3202,nu1503 COPY . . WORKDIR "/src/src/Services/Catalog/Catalog.API" RUN dotnet build "Catalog.API.csproj" diff --git a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json index f5e2b7149..598254915 100644 --- a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json +++ b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json @@ -27,8 +27,8 @@ "Azure Dev Spaces": { "commandName": "AzureDevSpaces", "launchBrowser": true, - "resourceGroup": "eshoptestedu", - "aksName": "eshoptestedu", + "resourceGroup": "edu-devspaces3", + "aksName": "edu-devspaces3", "subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759" } } diff --git a/src/Services/Catalog/Catalog.API/app.yaml b/src/Services/Catalog/Catalog.API/app.yaml new file mode 100644 index 000000000..c6209da47 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/app.yaml @@ -0,0 +1,39 @@ +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/azds.yaml b/src/Services/Catalog/Catalog.API/azds.yaml index 34397b646..7ea0ae087 100644 --- a/src/Services/Catalog/Catalog.API/azds.yaml +++ b/src/Services/Catalog/Catalog.API/azds.yaml @@ -4,19 +4,24 @@ build: context: ..\..\..\.. dockerfile: Dockerfile install: - chart: charts/catalogapi + chart: ../../../../k8s/helm/catalog-api values: - values.dev.yaml? - secrets.dev.yaml? + - inf.yaml + - app.yaml set: image: tag: $(tag) pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)basketapi$(hostSuffix)" disableProbes: true ingress: hosts: # This expands to [space.s.]catalogapi...aksapp.io - - $(spacePrefix)catalogapi$(hostSuffix) + - $(spacePrefix)basketapi$(hostSuffix) configurations: develop: build: diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore b/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore deleted file mode 100644 index f0c131944..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml deleted file mode 100644 index 1c221148d..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: catalogapi -version: 0.1.0 diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt deleted file mode 100644 index ed8159763..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt +++ /dev/null @@ -1,19 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range .Values.ingress.hosts }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "catalogapi.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get svc -w {{ template "catalogapi.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "catalogapi.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "catalogapi.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl deleted file mode 100644 index 908f9d8a3..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "catalogapi.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "catalogapi.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "catalogapi.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml deleted file mode 100644 index 1b3777856..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml +++ /dev/null @@ -1,72 +0,0 @@ -apiVersion: apps/v1beta2 -kind: Deployment -metadata: - name: {{ template "catalogapi.fullname" . }} - labels: - app: {{ template "catalogapi.name" . }} - chart: {{ template "catalogapi.chart" . }} - draft: {{ default "draft-app" .Values.draft }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "catalogapi.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "catalogapi.name" . }} - draft: {{ default "draft-app" .Values.draft }} - release: {{ .Release.Name }} - annotations: - buildID: {{ .Values.buildID }} - spec: - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: 80 - protocol: TCP - {{- if not .Values.disableProbes }} - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - {{- end }} - env: - {{- $root := . }} - {{- range $ref, $values := .Values.secrets }} - {{- range $key, $value := $values }} - - name: {{ $ref }}_{{ $key }} - valueFrom: - secretKeyRef: - name: {{ template "catalogapi.fullname" $root }}-{{ $ref | lower }} - key: {{ $key }} - {{- end }} - {{- end }} - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml deleted file mode 100644 index b52fc0f37..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml +++ /dev/null @@ -1,39 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "catalogapi.fullname" . -}} -{{- $servicePort := .Values.service.port -}} -{{- $ingressPath := .Values.ingress.path -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - app: {{ template "catalogapi.name" . }} - chart: {{ template "catalogapi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -{{- with .Values.ingress.annotations }} - annotations: -{{ toYaml . | indent 4 }} -{{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ . }} - http: - paths: - - path: {{ $ingressPath }} - backend: - serviceName: {{ $fullName }} - servicePort: http - {{- end }} -{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml deleted file mode 100644 index e13fb46d3..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- $root := . }} -{{- range $name, $values := .Values.secrets }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "catalogapi.fullname" $root }}-{{ $name | lower }} -data: - {{- range $key, $value := $values }} - {{ $key }}: {{ $value | b64enc }} - {{- end }} ---- -{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml deleted file mode 100644 index 1c3572dec..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "catalogapi.fullname" . }} - labels: - app: {{ template "catalogapi.name" . }} - chart: {{ template "catalogapi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - app: {{ template "catalogapi.name" . }} - release: {{ .Release.Name }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml deleted file mode 100644 index 5159ffa6e..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# Default values for catalogapi. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -fullnameOverride: catalogapi -replicaCount: 1 -image: - repository: catalogapi - tag: stable - pullPolicy: IfNotPresent -imagePullSecrets: [] - # Optionally specify an array of imagePullSecrets. - # Secrets must be manually created in the namespace. - # ref: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod - # - # This uses credentials from secret "myRegistryKeySecretName". - # - name: myRegistryKeySecretName -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - annotations: - kubernetes.io/ingress.class: addon-http-application-routing - # kubernetes.io/tls-acme: "true" - path: / - # hosts: - # - chart-example.local - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local -secrets: {} - # Optionally specify a set of secret objects whose values - # will be injected as environment variables by default. - # You should add this section to a file like secrets.yaml - # that is explicitly NOT committed to source code control - # and then include it as part of your helm install step. - # ref: https://kubernetes.io/docs/concepts/configuration/secret/ - # - # This creates a secret "mysecret" and injects "mypassword" - # as the environment variable mysecret_mypassword=password. - # mysecret: - # mypassword: password -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi -nodeSelector: {} - -tolerations: [] - -affinity: {} \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/inf.yaml b/src/Services/Catalog/Catalog.API/inf.yaml new file mode 100644 index 000000000..74a7762c4 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/inf.yaml @@ -0,0 +1,25 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + sql: # inf.sql defines the sql server databases & logins +# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used + common: + user: sa # SQL user + pwd: Pass@word # SQL pwd + pid: Developer + catalog: # inf.sql.catalog: settings for the catalog-api sql (user, pwd, db) + db: CatalogDb # Catalog API SQL db name + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/.dockerignore b/src/Services/Identity/Identity.API/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Services/Identity/Identity.API/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/Dockerfile.develop b/src/Services/Identity/Identity.API/Dockerfile.develop new file mode 100644 index 000000000..e2083dd40 --- /dev/null +++ b/src/Services/Identity/Identity.API/Dockerfile.develop @@ -0,0 +1,17 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/Services/Identity/Identity.API/Identity.API.csproj", "src/Services/Identity/Identity.API/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +RUN dotnet restore src/Services/Identity/Identity.API/Identity.API.csproj +COPY . . +WORKDIR "/src/src/Services/Identity/Identity.API" +RUN dotnet build "Identity.API.csproj" + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] diff --git a/src/Services/Identity/Identity.API/app.yaml b/src/Services/Identity/Identity.API/app.yaml new file mode 100644 index 000000000..c6209da47 --- /dev/null +++ b/src/Services/Identity/Identity.API/app.yaml @@ -0,0 +1,39 @@ +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/azds.yaml b/src/Services/Identity/Identity.API/azds.yaml new file mode 100644 index 000000000..7d1a00460 --- /dev/null +++ b/src/Services/Identity/Identity.API/azds.yaml @@ -0,0 +1,42 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/identity-api + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)identity$(hostSuffix)" + ingress: + hosts: + # This expands to [space.s.]identity...aksapp.io + - $(spacePrefix)identity(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Services/Identity/Identity.API/inf.yaml b/src/Services/Identity/Identity.API/inf.yaml new file mode 100644 index 000000000..a4c4b08ef --- /dev/null +++ b/src/Services/Identity/Identity.API/inf.yaml @@ -0,0 +1,29 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + sql: # inf.sql defines the sql server databases & logins +# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used + common: + user: sa # SQL user + pwd: Pass@word # SQL pwd + pid: Developer + identity: + db: IdentityDb # Ordering API SQL db name + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + redis: # inf.redis defines the redis' connection strings + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/.dockerignore b/src/Services/Ordering/Ordering.API/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Services/Ordering/Ordering.API/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Dockerfile.develop b/src/Services/Ordering/Ordering.API/Dockerfile.develop new file mode 100644 index 000000000..5f4cd3486 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/Dockerfile.develop @@ -0,0 +1,26 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["Ordering.API.csproj", "./"] +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +COPY ["src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj", "src/Services/Ordering/Ordering.Domain/"] +COPY ["src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj", "src/Services/Ordering/Ordering.Infrastructure/"] +COPY ["src/Services/Ordering/Ordering.API/Ordering.API.csproj", "src/Services/Ordering/Ordering.API/"] + +RUN dotnet restore src/Services/Ordering/Ordering.API/Ordering.API.csproj +COPY . . +WORKDIR /src/src/Services/Ordering/Ordering.API +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/app.yaml b/src/Services/Ordering/Ordering.API/app.yaml new file mode 100644 index 000000000..6ca5d9d31 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/app.yaml @@ -0,0 +1,43 @@ +# This heml values file defines app-based settings +# Charts use those values, so this file **MUST** be included in all chart releases + + +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing ap diff --git a/src/Services/Ordering/Ordering.API/azds.yaml b/src/Services/Ordering/Ordering.API/azds.yaml new file mode 100644 index 000000000..b81f9d773 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/azds.yaml @@ -0,0 +1,43 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/ordering-api + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)orderingapi$(hostSuffix)" + ingress: + hosts: + # This expands to [space.s.]orderingapi...aksapp.io + - $(spacePrefix)orderingapi$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Services/Ordering/Ordering.API/inf.yaml b/src/Services/Ordering/Ordering.API/inf.yaml new file mode 100644 index 000000000..943ec99fb --- /dev/null +++ b/src/Services/Ordering/Ordering.API/inf.yaml @@ -0,0 +1,22 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + sql: # inf.sql defines the sql server databases & logins +# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used + common: + user: sa # SQL user + pwd: Pass@word # SQL pwd + pid: Developer + ordering: # inf.sql.ordering: settings for the ordering-api sql (user, pwd, db) + db: OrderingDb # Ordering API SQL db name + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not From cfc1df7c564dc889be95fb371d5bc4b9ab81e618 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Thu, 2 Aug 2018 17:05:11 +0200 Subject: [PATCH 03/44] odering.api dockerfile.develop --- src/Services/Ordering/Ordering.API/Dockerfile.develop | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Services/Ordering/Ordering.API/Dockerfile.develop b/src/Services/Ordering/Ordering.API/Dockerfile.develop index 5f4cd3486..2106ff3da 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile.develop +++ b/src/Services/Ordering/Ordering.API/Dockerfile.develop @@ -5,7 +5,6 @@ ENV DOTNET_USE_POLLING_FILE_WATCHER=true EXPOSE 80 WORKDIR /src -COPY ["Ordering.API.csproj", "./"] COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] From 1b89edec1517080293f5773fd08ec9a40e958a64 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Wed, 29 Aug 2018 11:27:03 +0200 Subject: [PATCH 04/44] mvc devspace --- k8s/helm/webmvc/templates/configmap.yaml | 1 - src/Services/Catalog/Catalog.API/inf.yaml | 1 + src/Services/Identity/Identity.API/inf.yaml | 3 -- src/Web/WebMVC/.dockerignore | 14 +++++++ src/Web/WebMVC/Dockerfile.develop | 16 ++++++++ src/Web/WebMVC/app.yaml | 39 +++++++++++++++++++ src/Web/WebMVC/azds.yaml | 42 +++++++++++++++++++++ src/Web/WebMVC/inf.yaml | 24 ++++++++++++ src/Web/WebMVC/package-lock.json | 2 +- 9 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 src/Web/WebMVC/.dockerignore create mode 100644 src/Web/WebMVC/Dockerfile.develop create mode 100644 src/Web/WebMVC/app.yaml create mode 100644 src/Web/WebMVC/azds.yaml create mode 100644 src/Web/WebMVC/inf.yaml diff --git a/k8s/helm/webmvc/templates/configmap.yaml b/k8s/helm/webmvc/templates/configmap.yaml index 9d120fe7b..871f6c24e 100644 --- a/k8s/helm/webmvc/templates/configmap.yaml +++ b/k8s/helm/webmvc/templates/configmap.yaml @@ -2,7 +2,6 @@ {{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} {{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}} {{- $mvc := include "url-of" (list .Values.app.ingress.entries.mvc .) -}} -{{- $mongo := include "mongo-name" . -}} apiVersion: v1 diff --git a/src/Services/Catalog/Catalog.API/inf.yaml b/src/Services/Catalog/Catalog.API/inf.yaml index 74a7762c4..18e2c04bf 100644 --- a/src/Services/Catalog/Catalog.API/inf.yaml +++ b/src/Services/Catalog/Catalog.API/inf.yaml @@ -10,6 +10,7 @@ inf: pid: Developer catalog: # inf.sql.catalog: settings for the catalog-api sql (user, pwd, db) db: CatalogDb # Catalog API SQL db name + redis: keystore: svc: keystore-data # Name of k8s svc for keystore-data redis constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) diff --git a/src/Services/Identity/Identity.API/inf.yaml b/src/Services/Identity/Identity.API/inf.yaml index a4c4b08ef..dba30032b 100644 --- a/src/Services/Identity/Identity.API/inf.yaml +++ b/src/Services/Identity/Identity.API/inf.yaml @@ -10,9 +10,6 @@ inf: pid: Developer identity: db: IdentityDb # Ordering API SQL db name - keystore: - svc: keystore-data # Name of k8s svc for keystore-data redis - constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) redis: # inf.redis defines the redis' connection strings keystore: svc: keystore-data # Name of k8s svc for keystore-data redis diff --git a/src/Web/WebMVC/.dockerignore b/src/Web/WebMVC/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Web/WebMVC/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Web/WebMVC/Dockerfile.develop b/src/Web/WebMVC/Dockerfile.develop new file mode 100644 index 000000000..16041dc97 --- /dev/null +++ b/src/Web/WebMVC/Dockerfile.develop @@ -0,0 +1,16 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/Web/WebMVC/WebMVC.csproj", "src/Web/WebMVC/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +RUN dotnet restore "src/Web/WebMVC/WebMVC.csproj" +COPY . . +WORKDIR "/src/src/Web/WebMVC" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +ENTRYPOINT ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Web/WebMVC/app.yaml b/src/Web/WebMVC/app.yaml new file mode 100644 index 000000000..c6209da47 --- /dev/null +++ b/src/Web/WebMVC/app.yaml @@ -0,0 +1,39 @@ +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Web/WebMVC/azds.yaml b/src/Web/WebMVC/azds.yaml new file mode 100644 index 000000000..438b36f0d --- /dev/null +++ b/src/Web/WebMVC/azds.yaml @@ -0,0 +1,42 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\ + dockerfile: Dockerfile +install: + chart: ../../../k8s/helm/webmvc + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)webmvc$(hostSuffix)" + ingress: + hosts: + # This expands to [space.s.]webmvc...aksapp.io + - $(spacePrefix)webmvc$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Web/WebMVC/inf.yaml b/src/Web/WebMVC/inf.yaml new file mode 100644 index 000000000..9df900bae --- /dev/null +++ b/src/Web/WebMVC/inf.yaml @@ -0,0 +1,24 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + redis: + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + appinsights: + key: "" # App insights to use + k8s: {} + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not + +ingress: + annotations: + kubernetes.io/ingress.class: addon-http-application-routing + ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/ssl-redirect: "false" \ No newline at end of file diff --git a/src/Web/WebMVC/package-lock.json b/src/Web/WebMVC/package-lock.json index a94ca154f..785fd8273 100644 --- a/src/Web/WebMVC/package-lock.json +++ b/src/Web/WebMVC/package-lock.json @@ -19,7 +19,7 @@ "resolved": "https://registry.npmjs.org/toastr/-/toastr-2.1.4.tgz", "integrity": "sha1-i0O+ZPudDEFIcURvLbjoyk6V8YE=", "requires": { - "jquery": "3.3.1" + "jquery": ">=1.12.0" } } } From b95a4874495040d5eae2297d5794a5df67e6b3aa Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 1 Oct 2018 17:32:53 +0200 Subject: [PATCH 05/44] WIP on devspaces --- .../Mobile.Bff.Shopping/aggregator/Dockerfile.develop | 5 ++--- .../Mobile.Bff.Shopping/aggregator/azds.yaml | 11 ++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop index e34f6ac1d..10ef2c3d4 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -5,12 +5,11 @@ ENV DOTNET_USE_POLLING_FILE_WATCHER=true EXPOSE 80 WORKDIR /src -COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"] COPY ["src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj", "src/ApiGateways/Mobile.Bff.Shopping/aggregator/"] -RUN dotnet restore -nowarn:msb3202,nu1503 +RUN dotnet restore src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj -nowarn:msb3202,nu1503 COPY . . WORKDIR "/src/src/ApiGateways/Mobile.Bff.Shopping/aggregator" -RUN dotnet build "Mobile.Shopping.HttpAggregator.csproj" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml index dca11afbf..6537b476e 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml @@ -4,19 +4,24 @@ build: context: ..\..\..\.. dockerfile: Dockerfile install: - chart: charts/aggregator + chart: ../../../../k8s/helm/apigwms values: - values.dev.yaml? - secrets.dev.yaml? + - ..\..\..\..\k8s\helm\app.yaml + - ..\..\..\..\k8s\helm\inf.yaml set: image: tag: $(tag) pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)apigwms$(hostSuffix)" disableProbes: true ingress: hosts: - # This expands to [space.s.]aggregator...aksapp.io - - $(spacePrefix)aggregator$(hostSuffix) + # This expands to [space.s.]apigwms...aksapp.io + - $(spacePrefix)apigwms$(hostSuffix) configurations: develop: build: From 76118776c43952e48ac43cc61343268def4abb84 Mon Sep 17 00:00:00 2001 From: Mohsen Alikhani Date: Wed, 6 Feb 2019 20:08:22 +0330 Subject: [PATCH 06/44] OrderController Recommendation It's good idea to take advantage of GetOrderByIdQuery and handle by GetCustomerByIdQueryHandler --- .../Ordering/Ordering.API/Controllers/OrdersController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs index e2c711b69..5a00163a8 100644 --- a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs +++ b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs @@ -80,6 +80,8 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers { try { + //Todo: It's good idea to take advantage of GetOrderByIdQuery and handle by GetCustomerByIdQueryHandler + //var order customer = await _mediator.Send(new GetOrderByIdQuery(orderId)); var order = await _orderQueries.GetOrderAsync(orderId); return Ok(order); @@ -117,4 +119,4 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers return await _mediator.Send(createOrderDraftCommand); } } -} \ No newline at end of file +} From 820330556b8ca66e4309824c57eca031e598dcf4 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Wed, 13 Feb 2019 10:02:07 +0100 Subject: [PATCH 07/44] updated files to new devspaces format --- .../aggregator/Dockerfile.develop | 2 +- .../Basket/Basket.API/Dockerfile.develop | 2 +- .../Catalog/Catalog.API/Dockerfile.develop | 2 +- .../Identity/Identity.API/Dockerfile.develop | 2 +- .../Ordering/Ordering.API/Dockerfile.develop | 2 +- src/Web/WebMVC/Dockerfile.develop | 8 +++--- src/Web/WebMVC/azds.yaml | 27 +++++++++---------- src/Web/WebMVC/inf.yaml | 2 +- 8 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop index 10ef2c3d4..64e63de0f 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2.100-sdk ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true diff --git a/src/Services/Basket/Basket.API/Dockerfile.develop b/src/Services/Basket/Basket.API/Dockerfile.develop index b7d715b28..cd6252343 100644 --- a/src/Services/Basket/Basket.API/Dockerfile.develop +++ b/src/Services/Basket/Basket.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2.100-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true diff --git a/src/Services/Catalog/Catalog.API/Dockerfile.develop b/src/Services/Catalog/Catalog.API/Dockerfile.develop index b62c7f6e3..f6a111386 100644 --- a/src/Services/Catalog/Catalog.API/Dockerfile.develop +++ b/src/Services/Catalog/Catalog.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2.100-sdk ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true diff --git a/src/Services/Identity/Identity.API/Dockerfile.develop b/src/Services/Identity/Identity.API/Dockerfile.develop index e2083dd40..4d49cfdcb 100644 --- a/src/Services/Identity/Identity.API/Dockerfile.develop +++ b/src/Services/Identity/Identity.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2.100-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true diff --git a/src/Services/Ordering/Ordering.API/Dockerfile.develop b/src/Services/Ordering/Ordering.API/Dockerfile.develop index 2106ff3da..01b1e58c1 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile.develop +++ b/src/Services/Ordering/Ordering.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2.100-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true diff --git a/src/Web/WebMVC/Dockerfile.develop b/src/Web/WebMVC/Dockerfile.develop index 16041dc97..7e923c2b4 100644 --- a/src/Web/WebMVC/Dockerfile.develop +++ b/src/Web/WebMVC/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true @@ -6,11 +6,9 @@ EXPOSE 80 WORKDIR /src COPY ["src/Web/WebMVC/WebMVC.csproj", "src/Web/WebMVC/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] RUN dotnet restore "src/Web/WebMVC/WebMVC.csproj" COPY . . WORKDIR "/src/src/Web/WebMVC" -RUN dotnet build --no-restore -c $BUILD_CONFIGURATION +RUN dotnet build --no-restore "WebMVC.csproj" -c $BUILD_CONFIGURATION -ENTRYPOINT ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Web/WebMVC/azds.yaml b/src/Web/WebMVC/azds.yaml index 438b36f0d..5c95c50ee 100644 --- a/src/Web/WebMVC/azds.yaml +++ b/src/Web/WebMVC/azds.yaml @@ -1,40 +1,39 @@ kind: helm-release -apiVersion: 1.0 +apiVersion: 1.1 build: context: ..\..\..\ dockerfile: Dockerfile install: chart: ../../../k8s/helm/webmvc - values: - - values.dev.yaml? - - secrets.dev.yaml? - - inf.yaml - - app.yaml set: replicaCount: 1 image: tag: $(tag) pullPolicy: Never - inf: - k8s: - dns: "$(spacePrefix)webmvc$(hostSuffix)" ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]webmvc...aksapp.io - $(spacePrefix)webmvc$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml configurations: develop: build: - dockerfile: Dockerfile.develop useGitIgnore: true + dockerfile: Dockerfile.develop args: BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} container: sync: - - "**/Pages/**" - - "**/Views/**" - - "**/wwwroot/**" - - "!**/*.{sln,csproj}" + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] iterate: processesToKill: [dotnet, vsdbg] diff --git a/src/Web/WebMVC/inf.yaml b/src/Web/WebMVC/inf.yaml index 9df900bae..bac6d51a4 100644 --- a/src/Web/WebMVC/inf.yaml +++ b/src/Web/WebMVC/inf.yaml @@ -19,6 +19,6 @@ inf: ingress: annotations: - kubernetes.io/ingress.class: addon-http-application-routing +# kubernetes.io/ingress.class: addon-http-application-routing ingress.kubernetes.io/ssl-redirect: "false" nginx.ingress.kubernetes.io/ssl-redirect: "false" \ No newline at end of file From e310a525fe6ca41e370b0d96d5adbfc960e4bc23 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 13:26:31 +0100 Subject: [PATCH 08/44] Devspaces files for Apigateways, basket, ordering, aggregators --- src/ApiGateways/ApiGw-Base/Dockerfile.develop | 14 +++++ .../Mobile.Bff.Marketing/apigw/azds.yaml | 41 +++++++++++++++ .../apigw/values.dev.yaml | 2 + .../aggregator/Dockerfile.develop | 6 +-- .../Mobile.Bff.Shopping/aggregator/azds.yaml | 51 +++++++++++------- .../Mobile.Bff.Shopping/apigw/azds.yaml | 41 +++++++++++++++ .../Mobile.Bff.Shopping/apigw/values.dev.yaml | 2 + .../Web.Bff.Marketing/apigw/azds.yaml | 41 +++++++++++++++ .../Web.Bff.Marketing/apigw/values.dev.yaml | 2 + .../aggregator/Dockerfile.develop | 15 ++++++ .../Web.Bff.Shopping/aggregator/azds.yaml | 52 +++++++++++++++++++ .../Web.Bff.Shopping/apigw/azds.yaml | 41 +++++++++++++++ .../Web.Bff.Shopping/apigw/values.dev.yaml | 2 + .../Basket/Basket.API/Dockerfile.develop | 6 +-- src/Services/Basket/Basket.API/app.yaml | 43 --------------- src/Services/Basket/Basket.API/azds.yaml | 43 ++++++++++----- src/Services/Basket/Basket.API/inf.yaml | 18 ------- .../Catalog/Catalog.API/Dockerfile.develop | 14 ++--- src/Services/Catalog/Catalog.API/app.yaml | 39 -------------- src/Services/Catalog/Catalog.API/azds.yaml | 47 ++++++++++------- src/Services/Catalog/Catalog.API/inf.yaml | 26 ---------- src/Web/WebMVC/app.yaml | 39 -------------- src/Web/WebMVC/inf.yaml | 24 --------- src/prepare-devspaces.ps1 | 42 +++++++++++++++ 24 files changed, 394 insertions(+), 257 deletions(-) create mode 100644 src/ApiGateways/ApiGw-Base/Dockerfile.develop create mode 100644 src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml create mode 100644 src/ApiGateways/Mobile.Bff.Marketing/apigw/values.dev.yaml create mode 100644 src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml create mode 100644 src/ApiGateways/Mobile.Bff.Shopping/apigw/values.dev.yaml create mode 100644 src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml create mode 100644 src/ApiGateways/Web.Bff.Marketing/apigw/values.dev.yaml create mode 100644 src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop create mode 100644 src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml create mode 100644 src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml create mode 100644 src/ApiGateways/Web.Bff.Shopping/apigw/values.dev.yaml delete mode 100644 src/Services/Basket/Basket.API/app.yaml delete mode 100644 src/Services/Basket/Basket.API/inf.yaml delete mode 100644 src/Services/Catalog/Catalog.API/app.yaml delete mode 100644 src/Services/Catalog/Catalog.API/inf.yaml delete mode 100644 src/Web/WebMVC/app.yaml delete mode 100644 src/Web/WebMVC/inf.yaml create mode 100644 src/prepare-devspaces.ps1 diff --git a/src/ApiGateways/ApiGw-Base/Dockerfile.develop b/src/ApiGateways/ApiGw-Base/Dockerfile.develop new file mode 100644 index 000000000..4da230d68 --- /dev/null +++ b/src/ApiGateways/ApiGw-Base/Dockerfile.develop @@ -0,0 +1,14 @@ +FROM microsoft/dotnet:2.2-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj", "src/ApiGateways/ApiGw-Base/"] +RUN dotnet restore "src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj" +COPY . . +WORKDIR "/src/src/ApiGateways/ApiGw-Base" +RUN dotnet build --no-restore "OcelotApiGw.csproj" -c $BUILD_CONFIGURATION + +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml b/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml new file mode 100644 index 000000000..85c7a9f64 --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml @@ -0,0 +1,41 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\..\ + dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile +install: + chart: ../../../../k8s/helm/apigwwm + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + # This expands to [space.s.]webmvc...aksapp.io + - $(spacePrefix)apigwwm$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile.develop + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/ApiGateways/Mobile.Bff.Marketing/apigw/values.dev.yaml b/src/ApiGateways/Mobile.Bff.Marketing/apigw/values.dev.yaml new file mode 100644 index 000000000..fb59d98d5 --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Marketing/apigw/values.dev.yaml @@ -0,0 +1,2 @@ +ocelot: + configPath: /src/src/ApiGateways/ApiGw-Base/configuration \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop index 64e63de0f..16d42e393 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -1,7 +1,7 @@ -FROM microsoft/dotnet:2.2.100-sdk +FROM microsoft/dotnet:2.2-sdk +ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true - EXPOSE 80 WORKDIR /src @@ -12,4 +12,4 @@ COPY . . WORKDIR "/src/src/ApiGateways/Mobile.Bff.Shopping/aggregator" RUN dotnet build --no-restore -c $BUILD_CONFIGURATION -CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file +CMD ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml index 6537b476e..b4ffe0e20 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml @@ -1,41 +1,52 @@ kind: helm-release -apiVersion: 1.0 +apiVersion: 1.1 build: context: ..\..\..\.. dockerfile: Dockerfile install: - chart: ../../../../k8s/helm/apigwms - values: - - values.dev.yaml? - - secrets.dev.yaml? - - ..\..\..\..\k8s\helm\app.yaml - - ..\..\..\..\k8s\helm\inf.yaml + chart: ../../../../k8s/helm/mobileshoppingagg set: image: tag: $(tag) pullPolicy: Never - inf: - k8s: - dns: "$(spacePrefix)apigwms$(hostSuffix)" - disableProbes: true ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]apigwms...aksapp.io - - $(spacePrefix)apigwms$(hostSuffix) + - $(spacePrefix)mobileshoppingagg$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - app.yaml + - inf.yaml configurations: develop: build: - dockerfile: Dockerfile.develop useGitIgnore: true + dockerfile: Dockerfile.develop container: syncTarget: /src sync: - - "**/Pages/**" - - "**/Views/**" - - "**/wwwroot/**" - - "!**/*.{sln,csproj}" - command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${Configuration:-Debug}"] + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${Configuration:-Debug} iterate: - processesToKill: [dotnet, vsdbg] + processesToKill: + - dotnet + - vsdbg buildCommands: - - [dotnet, build, --no-restore, -c, "${Configuration:-Debug}"] + - - dotnet + - build + - --no-restore + - -c + - ${Configuration:-Debug} diff --git a/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml new file mode 100644 index 000000000..6e64cf5cf --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml @@ -0,0 +1,41 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\..\ + dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile +install: + chart: ../../../../k8s/helm/apigwms + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + # This expands to [space.s.]webmvc...aksapp.io + - $(spacePrefix)apigwms$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile.develop + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/ApiGateways/Mobile.Bff.Shopping/apigw/values.dev.yaml b/src/ApiGateways/Mobile.Bff.Shopping/apigw/values.dev.yaml new file mode 100644 index 000000000..fb59d98d5 --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/apigw/values.dev.yaml @@ -0,0 +1,2 @@ +ocelot: + configPath: /src/src/ApiGateways/ApiGw-Base/configuration \ No newline at end of file diff --git a/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml b/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml new file mode 100644 index 000000000..4d36cad78 --- /dev/null +++ b/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml @@ -0,0 +1,41 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\..\ + dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile +install: + chart: ../../../../k8s/helm/apigwmm + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + # This expands to [space.s.]webmvc...aksapp.io + - $(spacePrefix)apigwmm$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile.develop + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/ApiGateways/Web.Bff.Marketing/apigw/values.dev.yaml b/src/ApiGateways/Web.Bff.Marketing/apigw/values.dev.yaml new file mode 100644 index 000000000..fb59d98d5 --- /dev/null +++ b/src/ApiGateways/Web.Bff.Marketing/apigw/values.dev.yaml @@ -0,0 +1,2 @@ +ocelot: + configPath: /src/src/ApiGateways/ApiGw-Base/configuration \ No newline at end of file diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop new file mode 100644 index 000000000..c5c80af40 --- /dev/null +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop @@ -0,0 +1,15 @@ +FROM microsoft/dotnet:2.2-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj", "src/ApiGateways/Web.Bff.Shopping/aggregator/"] + +RUN dotnet restore src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj -nowarn:msb3202,nu1503 +COPY . . +WORKDIR "/src/src/ApiGateways/Web.Bff.Shopping/aggregator" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +CMD ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]] \ No newline at end of file diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml b/src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml new file mode 100644 index 000000000..63bb14c94 --- /dev/null +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml @@ -0,0 +1,52 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/webshoppingagg + set: + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + # This expands to [space.s.]apigwms...aksapp.io + - $(spacePrefix)webshoppingagg$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - app.yaml + - inf.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: Dockerfile.develop + container: + syncTarget: /src + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${Configuration:-Debug} + iterate: + processesToKill: + - dotnet + - vsdbg + buildCommands: + - - dotnet + - build + - --no-restore + - -c + - ${Configuration:-Debug} diff --git a/src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml b/src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml new file mode 100644 index 000000000..3aff7a62b --- /dev/null +++ b/src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml @@ -0,0 +1,41 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\..\ + dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile +install: + chart: ../../../../k8s/helm/apigwws + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + # This expands to [space.s.]webmvc...aksapp.io + - $(spacePrefix)apigwws$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile.develop + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/ApiGateways/Web.Bff.Shopping/apigw/values.dev.yaml b/src/ApiGateways/Web.Bff.Shopping/apigw/values.dev.yaml new file mode 100644 index 000000000..fb59d98d5 --- /dev/null +++ b/src/ApiGateways/Web.Bff.Shopping/apigw/values.dev.yaml @@ -0,0 +1,2 @@ +ocelot: + configPath: /src/src/ApiGateways/ApiGw-Base/configuration \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/Dockerfile.develop b/src/Services/Basket/Basket.API/Dockerfile.develop index cd6252343..5ae5cc235 100644 --- a/src/Services/Basket/Basket.API/Dockerfile.develop +++ b/src/Services/Basket/Basket.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.2.100-sdk +FROM microsoft/dotnet:2.2-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true @@ -9,8 +9,6 @@ WORKDIR /src COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] COPY ["src/Services/Basket/Basket.API/Basket.API.csproj", "src/Services/Basket/Basket.API/"] RUN dotnet restore src/Services/Basket/Basket.API/Basket.API.csproj -nowarn:msb3202,nu1503 @@ -18,4 +16,4 @@ COPY . . WORKDIR /src/src/Services/Basket/Basket.API RUN dotnet build --no-restore -c $BUILD_CONFIGURATION -CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/app.yaml b/src/Services/Basket/Basket.API/app.yaml deleted file mode 100644 index 6ca5d9d31..000000000 --- a/src/Services/Basket/Basket.API/app.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# This heml values file defines app-based settings -# Charts use those values, so this file **MUST** be included in all chart releases - - -app: # app global settings - name: "my-eshop" # Override for custom app name - ingress: # ingress related settings - entries: - basket: basket-api # ingress entry for basket api - catalog: catalog-api # ingress entry for catalog api - ordering: ordering-api # ingress entry for ordering api - identity: identity # ingress entry for identity api - mvc: webmvc # ingress entry for web mvc - spa: "" # ingress entry for web spa - status: webstatus # ingress entry for web status - webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw - webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw - mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw - webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator - mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator - payment: payment-api # ingress entry for payment api - locations: locations-api # ingress entry for locations api - marketing: marketing-api # ingress entry for marketing api - svc: - basket: basket # service name for basket api - catalog: catalog # service name for catalog api - ordering: ordering # service name for ordering api - orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks - orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub - identity: identity # service name for identity api - mvc: webmvc # service name for web mvc - spa: webspa # service name for web spa - status: webstatus # service name for web status - webshoppingapigw: webshoppingapigw # service name for web shopping Agw - webmarketingapigw: webmarketingapigw # service name for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw - mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw - webshoppingagg: webshoppingagg # service name for web shopping aggregator - mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator - payment: payment # service name for payment api - locations: locations # service name for locations api - marketing: marketing # service name for marketing ap diff --git a/src/Services/Basket/Basket.API/azds.yaml b/src/Services/Basket/Basket.API/azds.yaml index 597c79d8c..79baa83db 100644 --- a/src/Services/Basket/Basket.API/azds.yaml +++ b/src/Services/Basket/Basket.API/azds.yaml @@ -1,39 +1,54 @@ kind: helm-release -apiVersion: 1.0 +apiVersion: 1.1 build: context: ..\..\..\.. dockerfile: Dockerfile install: chart: ../../../../k8s/helm/basket-api - values: - - values.dev.yaml? - - secrets.dev.yaml? - - inf.yaml - - app.yaml set: replicaCount: 1 image: tag: $(tag) pullPolicy: Never ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]basketapi...aksapp.io - $(spacePrefix)basketapi$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml configurations: develop: build: - dockerfile: Dockerfile.develop useGitIgnore: true + dockerfile: Dockerfile.develop args: BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} container: sync: - - "**/Pages/**" - - "**/Views/**" - - "**/wwwroot/**" - - "!**/*.{sln,csproj}" - command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${BUILD_CONFIGURATION:-Debug} iterate: - processesToKill: [dotnet, vsdbg] + processesToKill: + - dotnet + - vsdbg buildCommands: - - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] + - - dotnet + - build + - --no-restore + - -c + - ${BUILD_CONFIGURATION:-Debug} diff --git a/src/Services/Basket/Basket.API/inf.yaml b/src/Services/Basket/Basket.API/inf.yaml deleted file mode 100644 index 3e3e143da..000000000 --- a/src/Services/Basket/Basket.API/inf.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# This heml values file defines all infrastructure used by eShopOnContainers. -# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment - -inf: - redis: # inf.redis defines the redis' connection strings - basket: - svc: basket-data # Name of k8s svc for basket redis - constr: basket-data # Connection string to Redis used by Basket API - eventbus: - svc: rabbitmq # Name of k8s svc for rabbitmq - constr: rabbitmq # Event bus connection string - useAzure: false # true if use Azure Service Bus. False if RabbitMQ - appinsights: - key: "" # App insights to use - k8s: {} - misc: # inf.misc contains miscellaneous configuration related to infrastructure - useLoadTest: false # If running under loading test or not - useAzureStorage: false # If catalog api uses azure storage or not diff --git a/src/Services/Catalog/Catalog.API/Dockerfile.develop b/src/Services/Catalog/Catalog.API/Dockerfile.develop index f6a111386..11034a2bc 100644 --- a/src/Services/Catalog/Catalog.API/Dockerfile.develop +++ b/src/Services/Catalog/Catalog.API/Dockerfile.develop @@ -1,25 +1,21 @@ -FROM microsoft/dotnet:2.2.100-sdk +FROM microsoft/dotnet:2.2-sdk +ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true - EXPOSE 80 WORKDIR /src -COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"] + COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] COPY ["src/Services/Catalog/Catalog.API/Catalog.API.csproj", "src/Services/Catalog/Catalog.API/"] RUN dotnet restore src/Services/Catalog/Catalog.API/Catalog.API.csproj -nowarn:msb3202,nu1503 COPY . . WORKDIR "/src/src/Services/Catalog/Catalog.API" -RUN dotnet build "Catalog.API.csproj" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION -CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/app.yaml b/src/Services/Catalog/Catalog.API/app.yaml deleted file mode 100644 index c6209da47..000000000 --- a/src/Services/Catalog/Catalog.API/app.yaml +++ /dev/null @@ -1,39 +0,0 @@ -app: # app global settings - name: "my-eshop" # Override for custom app name - ingress: # ingress related settings - entries: - basket: basket-api # ingress entry for basket api - catalog: catalog-api # ingress entry for catalog api - ordering: ordering-api # ingress entry for ordering api - identity: identity # ingress entry for identity api - mvc: webmvc # ingress entry for web mvc - spa: "" # ingress entry for web spa - status: webstatus # ingress entry for web status - webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw - webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw - mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw - webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator - mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator - payment: payment-api # ingress entry for payment api - locations: locations-api # ingress entry for locations api - marketing: marketing-api # ingress entry for marketing api - svc: - basket: basket # service name for basket api - catalog: catalog # service name for catalog api - ordering: ordering # service name for ordering api - orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks - orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub - identity: identity # service name for identity api - mvc: webmvc # service name for web mvc - spa: webspa # service name for web spa - status: webstatus # service name for web status - webshoppingapigw: webshoppingapigw # service name for web shopping Agw - webmarketingapigw: webmarketingapigw # service name for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw - mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw - webshoppingagg: webshoppingagg # service name for web shopping aggregator - mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator - payment: payment # service name for payment api - locations: locations # service name for locations api - marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/azds.yaml b/src/Services/Catalog/Catalog.API/azds.yaml index 7ea0ae087..cbceada43 100644 --- a/src/Services/Catalog/Catalog.API/azds.yaml +++ b/src/Services/Catalog/Catalog.API/azds.yaml @@ -1,41 +1,52 @@ kind: helm-release -apiVersion: 1.0 +apiVersion: 1.1 build: context: ..\..\..\.. dockerfile: Dockerfile install: chart: ../../../../k8s/helm/catalog-api - values: - - values.dev.yaml? - - secrets.dev.yaml? - - inf.yaml - - app.yaml set: image: tag: $(tag) pullPolicy: Never - inf: - k8s: - dns: "$(spacePrefix)basketapi$(hostSuffix)" - disableProbes: true ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]catalogapi...aksapp.io - $(spacePrefix)basketapi$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml configurations: develop: build: - dockerfile: Dockerfile.develop useGitIgnore: true + dockerfile: Dockerfile.develop container: syncTarget: /src sync: - - "**/Pages/**" - - "**/Views/**" - - "**/wwwroot/**" - - "!**/*.{sln,csproj}" - command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${Configuration:-Debug}"] + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${Configuration:-Debug} iterate: - processesToKill: [dotnet, vsdbg] + processesToKill: + - dotnet + - vsdbg buildCommands: - - [dotnet, build, --no-restore, -c, "${Configuration:-Debug}"] + - - dotnet + - build + - --no-restore + - -c + - ${Configuration:-Debug} diff --git a/src/Services/Catalog/Catalog.API/inf.yaml b/src/Services/Catalog/Catalog.API/inf.yaml deleted file mode 100644 index 18e2c04bf..000000000 --- a/src/Services/Catalog/Catalog.API/inf.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# This heml values file defines all infrastructure used by eShopOnContainers. -# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment - -inf: - sql: # inf.sql defines the sql server databases & logins -# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used - common: - user: sa # SQL user - pwd: Pass@word # SQL pwd - pid: Developer - catalog: # inf.sql.catalog: settings for the catalog-api sql (user, pwd, db) - db: CatalogDb # Catalog API SQL db name - redis: - keystore: - svc: keystore-data # Name of k8s svc for keystore-data redis - constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) - eventbus: - svc: rabbitmq # Name of k8s svc for rabbitmq - constr: rabbitmq # Event bus connection string - useAzure: false # true if use Azure Service Bus. False if RabbitMQ - appinsights: - key: "" # App insights to use - k8s: {} - misc: # inf.misc contains miscellaneous configuration related to infrastructure - useLoadTest: false # If running under loading test or not - useAzureStorage: false # If catalog api uses azure storage or not \ No newline at end of file diff --git a/src/Web/WebMVC/app.yaml b/src/Web/WebMVC/app.yaml deleted file mode 100644 index c6209da47..000000000 --- a/src/Web/WebMVC/app.yaml +++ /dev/null @@ -1,39 +0,0 @@ -app: # app global settings - name: "my-eshop" # Override for custom app name - ingress: # ingress related settings - entries: - basket: basket-api # ingress entry for basket api - catalog: catalog-api # ingress entry for catalog api - ordering: ordering-api # ingress entry for ordering api - identity: identity # ingress entry for identity api - mvc: webmvc # ingress entry for web mvc - spa: "" # ingress entry for web spa - status: webstatus # ingress entry for web status - webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw - webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw - mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw - webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator - mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator - payment: payment-api # ingress entry for payment api - locations: locations-api # ingress entry for locations api - marketing: marketing-api # ingress entry for marketing api - svc: - basket: basket # service name for basket api - catalog: catalog # service name for catalog api - ordering: ordering # service name for ordering api - orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks - orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub - identity: identity # service name for identity api - mvc: webmvc # service name for web mvc - spa: webspa # service name for web spa - status: webstatus # service name for web status - webshoppingapigw: webshoppingapigw # service name for web shopping Agw - webmarketingapigw: webmarketingapigw # service name for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw - mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw - webshoppingagg: webshoppingagg # service name for web shopping aggregator - mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator - payment: payment # service name for payment api - locations: locations # service name for locations api - marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Web/WebMVC/inf.yaml b/src/Web/WebMVC/inf.yaml deleted file mode 100644 index bac6d51a4..000000000 --- a/src/Web/WebMVC/inf.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# This heml values file defines all infrastructure used by eShopOnContainers. -# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment - -inf: - redis: - keystore: - svc: keystore-data # Name of k8s svc for keystore-data redis - constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) - appinsights: - key: "" # App insights to use - k8s: {} - eventbus: - svc: rabbitmq # Name of k8s svc for rabbitmq - constr: rabbitmq # Event bus connection string - useAzure: false # true if use Azure Service Bus. False if RabbitMQ - misc: # inf.misc contains miscellaneous configuration related to infrastructure - useLoadTest: false # If running under loading test or not - useAzureStorage: false # If catalog api uses azure storage or not - -ingress: - annotations: -# kubernetes.io/ingress.class: addon-http-application-routing - ingress.kubernetes.io/ssl-redirect: "false" - nginx.ingress.kubernetes.io/ssl-redirect: "false" \ No newline at end of file diff --git a/src/prepare-devspaces.ps1 b/src/prepare-devspaces.ps1 new file mode 100644 index 000000000..b1ffce413 --- /dev/null +++ b/src/prepare-devspaces.ps1 @@ -0,0 +1,42 @@ +# This script just copies app.yaml and inf.yaml files to all devspaces projects. +# This is to workaround issue #56 - https://github.com/Azure/dev-spaces/issues/56 + +Write-Host "Copying app.yaml and inf.yaml to Mobile.Bff.Marketing" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\ApiGateways\Mobile.Bff.Marketing\apigw" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\ApiGateways\Mobile.Bff.Marketing\apigw" -Force + +Write-Host "Copying app.yaml and inf.yaml to Web.Bff.Marketing" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\ApiGateways\Web.Bff.Marketing\apigw" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\ApiGateways\Web.Bff.Marketing\apigw" -Force + +Write-Host "Copying app.yaml and inf.yaml to Mobile.Bff.Shopping" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\ApiGateways\Mobile.Bff.Shopping\apigw" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\ApiGateways\Mobile.Bff.Shopping\apigw" -Force + +Write-Host "Copying app.yaml and inf.yaml to Web.Bff.Shopping" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\ApiGateways\Web.Bff.Shopping\apigw" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\ApiGateways\Web.Bff.Shopping\apigw" -Force + +Write-Host "Copying app.yaml and inf.yaml to Mobile.Bff Shopping Aggregator" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\ApiGateways\Mobile.Bff.Shopping\aggregator" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\ApiGateways\Mobile.Bff.Shopping\aggregator" -Force + +Write-Host "Copying app.yaml and inf.yaml to Web.Bff Shopping Aggregator" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\ApiGateways\Web.Bff.Shopping\aggregator" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\ApiGateways\Web.Bff.Shopping\aggregator" -Force + +Write-Host "Copying app.yaml and inf.yaml to Basket API" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Basket\Basket.API" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Basket\Basket.API" -Force + +Write-Host "Copying app.yaml and inf.yaml to Catalog API" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Catalog\Catalog.API" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Catalog\Catalog.API" -Force + +Write-Host "Copying app.yaml and inf.yaml to WebMVC" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Web\WebMVC" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Web\WebMVC" -Force + + + + From 631696c4ae88cf4f787e674cdeee28cca12a10ba Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 13:27:26 +0100 Subject: [PATCH 09/44] Updated helm charts to support devspaces --- .gitignore | 7 +++++- k8s/helm/apigwmm/templates/deployment.yaml | 2 +- k8s/helm/apigwmm/templates/ingress.yaml | 7 ++++-- k8s/helm/apigwmm/values.yaml | 2 ++ k8s/helm/apigwms/templates/deployment.yaml | 2 +- k8s/helm/apigwms/values.yaml | 4 +++- k8s/helm/apigwwm/templates/deployment.yaml | 2 +- k8s/helm/apigwwm/values.yaml | 4 +++- k8s/helm/deploy-all.ps1 | 27 ++++++++++++++-------- k8s/helm/webmvc/templates/ingress.yaml | 7 ++++-- 10 files changed, 45 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 6bc27551d..2e9297be9 100644 --- a/.gitignore +++ b/.gitignore @@ -265,4 +265,9 @@ pub/ .mfractor # Ignore HealthCheckdb -*healthchecksdb* \ No newline at end of file +*healthchecksdb* + +# Ignores all extra inf.yaml and app.yaml that are copied by prepare-devspaces.ps1 +src/**/app.yaml +src/**/inf.yaml + diff --git a/k8s/helm/apigwmm/templates/deployment.yaml b/k8s/helm/apigwmm/templates/deployment.yaml index 6dc58bf50..46e5bee24 100644 --- a/k8s/helm/apigwmm/templates/deployment.yaml +++ b/k8s/helm/apigwmm/templates/deployment.yaml @@ -61,7 +61,7 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: config - mountPath: /app/configuration + mountPath: {{ .Values.ocelot.configPath }} env: - name: PATH_BASE value: {{ include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) }} diff --git a/k8s/helm/apigwmm/templates/ingress.yaml b/k8s/helm/apigwmm/templates/ingress.yaml index 28e2aa84d..ec6d078bd 100644 --- a/k8s/helm/apigwmm/templates/ingress.yaml +++ b/k8s/helm/apigwmm/templates/ingress.yaml @@ -1,5 +1,6 @@ {{- if .Values.ingress.enabled -}} {{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) -}} +{{- $serviceName := .Values.app.svc.mobilemarketingapigw -}} apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -23,11 +24,13 @@ spec: {{- end }} {{- end }} rules: - - host: {{ .Values.inf.k8s.dns }} + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ .Values.app.svc.mobilemarketingapigw }} + serviceName: {{ $serviceName }} servicePort: http + {{- end }} {{- end }} diff --git a/k8s/helm/apigwmm/values.yaml b/k8s/helm/apigwmm/values.yaml index 501266780..ea87a6c05 100644 --- a/k8s/helm/apigwmm/values.yaml +++ b/k8s/helm/apigwmm/values.yaml @@ -62,3 +62,5 @@ probes: initialDelaySeconds: 90 periodSeconds: 60 port: 80 +ocelot: + configPath: /app/configuration diff --git a/k8s/helm/apigwms/templates/deployment.yaml b/k8s/helm/apigwms/templates/deployment.yaml index 8a4fd8942..65522e986 100644 --- a/k8s/helm/apigwms/templates/deployment.yaml +++ b/k8s/helm/apigwms/templates/deployment.yaml @@ -61,7 +61,7 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: config - mountPath: /app/configuration + mountPath: {{ .Values ocelot.configPath }} env: - name: PATH_BASE value: {{ include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) }} diff --git a/k8s/helm/apigwms/values.yaml b/k8s/helm/apigwms/values.yaml index 58377ec5b..650ab6449 100644 --- a/k8s/helm/apigwms/values.yaml +++ b/k8s/helm/apigwms/values.yaml @@ -61,4 +61,6 @@ probes: timeoutSeconds: 5 initialDelaySeconds: 90 periodSeconds: 60 - port: 80 \ No newline at end of file + port: 80 +ocelot: + configPath: /app/configuration \ No newline at end of file diff --git a/k8s/helm/apigwwm/templates/deployment.yaml b/k8s/helm/apigwwm/templates/deployment.yaml index 5cbce9f22..4f02bc2e9 100644 --- a/k8s/helm/apigwwm/templates/deployment.yaml +++ b/k8s/helm/apigwwm/templates/deployment.yaml @@ -61,7 +61,7 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: config - mountPath: /app/configuration + mountPath: {{ .Values ocelot.configPath }} env: - name: PATH_BASE value: {{ include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) }} diff --git a/k8s/helm/apigwwm/values.yaml b/k8s/helm/apigwwm/values.yaml index 68cbb89c4..63deb5832 100644 --- a/k8s/helm/apigwwm/values.yaml +++ b/k8s/helm/apigwwm/values.yaml @@ -61,4 +61,6 @@ probes: timeoutSeconds: 5 initialDelaySeconds: 90 periodSeconds: 60 - port: 80 \ No newline at end of file + port: 80 +ocelot: + configPath: /app/configuration \ No newline at end of file diff --git a/k8s/helm/deploy-all.ps1 b/k8s/helm/deploy-all.ps1 index 1819c9a67..b7275891d 100644 --- a/k8s/helm/deploy-all.ps1 +++ b/k8s/helm/deploy-all.ps1 @@ -5,6 +5,7 @@ Param( [parameter(Mandatory=$false)][string]$externalDns, [parameter(Mandatory=$false)][string]$appName="eshop", [parameter(Mandatory=$false)][bool]$deployInfrastructure=$true, + [parameter(Mandatory=$false)][bool]$deployCharts=$true, [parameter(Mandatory=$false)][bool]$clean=$true, [parameter(Mandatory=$false)][string]$aksName="", [parameter(Mandatory=$false)][string]$aksRg="", @@ -66,21 +67,29 @@ $charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-a if ($deployInfrastructure) { foreach ($infra in $infras) { Write-Host "Installing infrastructure: $infra" -ForegroundColor Green - helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --name="$appName-$infra" $infra + helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --name="$appName-$infra" $infra } } +else { + Write-Host "eShopOnContainers infrastructure (bbdd, redis, ...) charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow +} -foreach ($chart in $charts) { - Write-Host "Installing: $chart" -ForegroundColor Green - if ($useCustomRegistry) { - helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart - } - else { - if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed - helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart +if ($deployCharts) { + foreach ($chart in $charts) { + Write-Host "Installing: $chart" -ForegroundColor Green + if ($useCustomRegistry) { + helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart + } + else { + if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed + helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart + } } } } +else { + Write-Host "eShopOnContainers non-infrastructure charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow +} Write-Host "helm charts installed." -ForegroundColor Green diff --git a/k8s/helm/webmvc/templates/ingress.yaml b/k8s/helm/webmvc/templates/ingress.yaml index abfb62b2f..892fa4273 100644 --- a/k8s/helm/webmvc/templates/ingress.yaml +++ b/k8s/helm/webmvc/templates/ingress.yaml @@ -1,5 +1,6 @@ {{- if .Values.ingress.enabled -}} {{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.mvc -}} apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -23,11 +24,13 @@ spec: {{- end }} {{- end }} rules: - - host: {{ .Values.inf.k8s.dns }} + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ .Values.app.svc.mvc }} + serviceName: {{ $serviceName }} servicePort: http + {{- end }} {{- end }} From 1c776776c9ad33faebd914f6d8a2ea66d02fa362 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 15:35:33 +0100 Subject: [PATCH 10/44] Identity.API devspaces setup --- k8s/helm/identity-api/templates/ingress.yaml | 7 ++- .../Identity/Identity.API/Dockerfile.develop | 10 ++-- src/Services/Identity/Identity.API/app.yaml | 39 --------------- src/Services/Identity/Identity.API/azds.yaml | 48 ++++++++++++------- src/Services/Identity/Identity.API/inf.yaml | 26 ---------- src/prepare-devspaces.ps1 | 4 ++ 6 files changed, 43 insertions(+), 91 deletions(-) delete mode 100644 src/Services/Identity/Identity.API/app.yaml delete mode 100644 src/Services/Identity/Identity.API/inf.yaml diff --git a/k8s/helm/identity-api/templates/ingress.yaml b/k8s/helm/identity-api/templates/ingress.yaml index 5824f91e2..1d2d3d5d5 100644 --- a/k8s/helm/identity-api/templates/ingress.yaml +++ b/k8s/helm/identity-api/templates/ingress.yaml @@ -1,5 +1,6 @@ {{- if .Values.ingress.enabled -}} {{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.identity }} apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -23,11 +24,13 @@ spec: {{- end }} {{- end }} rules: - - host: {{ .Values.inf.k8s.dns }} + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ .Values.app.svc.identity }} + serviceName: {{ $serviceName }} servicePort: http + {{- end }} {{- end }} diff --git a/src/Services/Identity/Identity.API/Dockerfile.develop b/src/Services/Identity/Identity.API/Dockerfile.develop index 4d49cfdcb..3ab1fbe7c 100644 --- a/src/Services/Identity/Identity.API/Dockerfile.develop +++ b/src/Services/Identity/Identity.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.2.100-sdk +FROM microsoft/dotnet:2.2-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true @@ -6,12 +6,10 @@ EXPOSE 80 WORKDIR /src COPY ["src/Services/Identity/Identity.API/Identity.API.csproj", "src/Services/Identity/Identity.API/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] -RUN dotnet restore src/Services/Identity/Identity.API/Identity.API.csproj +RUN dotnet restore src/Services/Identity/Identity.API/Identity.API.csproj -nowarn:msb3202,nu1503 COPY . . WORKDIR "/src/src/Services/Identity/Identity.API" -RUN dotnet build "Identity.API.csproj" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION -CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] diff --git a/src/Services/Identity/Identity.API/app.yaml b/src/Services/Identity/Identity.API/app.yaml deleted file mode 100644 index c6209da47..000000000 --- a/src/Services/Identity/Identity.API/app.yaml +++ /dev/null @@ -1,39 +0,0 @@ -app: # app global settings - name: "my-eshop" # Override for custom app name - ingress: # ingress related settings - entries: - basket: basket-api # ingress entry for basket api - catalog: catalog-api # ingress entry for catalog api - ordering: ordering-api # ingress entry for ordering api - identity: identity # ingress entry for identity api - mvc: webmvc # ingress entry for web mvc - spa: "" # ingress entry for web spa - status: webstatus # ingress entry for web status - webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw - webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw - mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw - webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator - mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator - payment: payment-api # ingress entry for payment api - locations: locations-api # ingress entry for locations api - marketing: marketing-api # ingress entry for marketing api - svc: - basket: basket # service name for basket api - catalog: catalog # service name for catalog api - ordering: ordering # service name for ordering api - orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks - orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub - identity: identity # service name for identity api - mvc: webmvc # service name for web mvc - spa: webspa # service name for web spa - status: webstatus # service name for web status - webshoppingapigw: webshoppingapigw # service name for web shopping Agw - webmarketingapigw: webmarketingapigw # service name for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw - mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw - webshoppingagg: webshoppingagg # service name for web shopping aggregator - mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator - payment: payment # service name for payment api - locations: locations # service name for locations api - marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/azds.yaml b/src/Services/Identity/Identity.API/azds.yaml index 7d1a00460..117a3f6ae 100644 --- a/src/Services/Identity/Identity.API/azds.yaml +++ b/src/Services/Identity/Identity.API/azds.yaml @@ -1,42 +1,54 @@ kind: helm-release -apiVersion: 1.0 +apiVersion: 1.1 build: context: ..\..\..\.. dockerfile: Dockerfile install: chart: ../../../../k8s/helm/identity-api - values: - - values.dev.yaml? - - secrets.dev.yaml? - - inf.yaml - - app.yaml set: replicaCount: 1 image: tag: $(tag) pullPolicy: Never - inf: - k8s: - dns: "$(spacePrefix)identity$(hostSuffix)" ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]identity...aksapp.io - - $(spacePrefix)identity(hostSuffix) + - $(spacePrefix)identity-api$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml configurations: develop: build: - dockerfile: Dockerfile.develop useGitIgnore: true + dockerfile: Dockerfile.develop args: BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} container: sync: - - "**/Pages/**" - - "**/Views/**" - - "**/wwwroot/**" - - "!**/*.{sln,csproj}" - command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${BUILD_CONFIGURATION:-Debug} iterate: - processesToKill: [dotnet, vsdbg] + processesToKill: + - dotnet + - vsdbg buildCommands: - - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] + - - dotnet + - build + - --no-restore + - -c + - ${BUILD_CONFIGURATION:-Debug} diff --git a/src/Services/Identity/Identity.API/inf.yaml b/src/Services/Identity/Identity.API/inf.yaml deleted file mode 100644 index dba30032b..000000000 --- a/src/Services/Identity/Identity.API/inf.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# This heml values file defines all infrastructure used by eShopOnContainers. -# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment - -inf: - sql: # inf.sql defines the sql server databases & logins -# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used - common: - user: sa # SQL user - pwd: Pass@word # SQL pwd - pid: Developer - identity: - db: IdentityDb # Ordering API SQL db name - redis: # inf.redis defines the redis' connection strings - keystore: - svc: keystore-data # Name of k8s svc for keystore-data redis - constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) - eventbus: - svc: rabbitmq # Name of k8s svc for rabbitmq - constr: rabbitmq # Event bus connection string - useAzure: false # true if use Azure Service Bus. False if RabbitMQ - appinsights: - key: "" # App insights to use - k8s: {} - misc: # inf.misc contains miscellaneous configuration related to infrastructure - useLoadTest: false # If running under loading test or not - useAzureStorage: false # If catalog api uses azure storage or not \ No newline at end of file diff --git a/src/prepare-devspaces.ps1 b/src/prepare-devspaces.ps1 index b1ffce413..2bb7f4135 100644 --- a/src/prepare-devspaces.ps1 +++ b/src/prepare-devspaces.ps1 @@ -33,6 +33,10 @@ Write-Host "Copying app.yaml and inf.yaml to Catalog API" -ForegroundColor Yello Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Catalog\Catalog.API" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Catalog\Catalog.API" -Force +Write-Host "Copying app.yaml and inf.yaml to Identity API" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Identity\Identity.API" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Identity\Identity.API" -Force + Write-Host "Copying app.yaml and inf.yaml to WebMVC" -ForegroundColor Yellow Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Web\WebMVC" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Web\WebMVC" -Force From 89a0695779172f1e8d11131f3dc70a9784792ccf Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 16:10:45 +0100 Subject: [PATCH 11/44] Locations API devspaces --- .../Location/Locations.API/Dockerfile.develop | 17 ++++++ src/Services/Location/Locations.API/azds.yaml | 54 +++++++++++++++++++ src/prepare-devspaces.ps1 | 4 ++ 3 files changed, 75 insertions(+) create mode 100644 src/Services/Location/Locations.API/Dockerfile.develop create mode 100644 src/Services/Location/Locations.API/azds.yaml diff --git a/src/Services/Location/Locations.API/Dockerfile.develop b/src/Services/Location/Locations.API/Dockerfile.develop new file mode 100644 index 000000000..a847b6c30 --- /dev/null +++ b/src/Services/Location/Locations.API/Dockerfile.develop @@ -0,0 +1,17 @@ +FROM microsoft/dotnet:2.2-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/Services/Location/Locations.API/Locations.API.csproj", "src/Services/Location/Locations.API/"] +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +RUN dotnet restore src/Services/Location/Locations.API/Locations.API.csproj -nowarn:msb3202,nu1503 +COPY . . +WORKDIR "/src/src/Services/Location/Locations.API" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] diff --git a/src/Services/Location/Locations.API/azds.yaml b/src/Services/Location/Locations.API/azds.yaml new file mode 100644 index 000000000..f528f62cd --- /dev/null +++ b/src/Services/Location/Locations.API/azds.yaml @@ -0,0 +1,54 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/locations-api + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + # This expands to [space.s.]identity...aksapp.io + - $(spacePrefix)locations-api$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: Dockerfile.develop + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${BUILD_CONFIGURATION:-Debug} + iterate: + processesToKill: + - dotnet + - vsdbg + buildCommands: + - - dotnet + - build + - --no-restore + - -c + - ${BUILD_CONFIGURATION:-Debug} diff --git a/src/prepare-devspaces.ps1 b/src/prepare-devspaces.ps1 index 2bb7f4135..e79dbd4ab 100644 --- a/src/prepare-devspaces.ps1 +++ b/src/prepare-devspaces.ps1 @@ -37,6 +37,10 @@ Write-Host "Copying app.yaml and inf.yaml to Identity API" -ForegroundColor Yell Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Identity\Identity.API" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Identity\Identity.API" -Force +Write-Host "Copying app.yaml and inf.yaml to Locations API" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Location\Locations.API" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Location\Locations.API" -Force + Write-Host "Copying app.yaml and inf.yaml to WebMVC" -ForegroundColor Yellow Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Web\WebMVC" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Web\WebMVC" -Force From 17237710303cbcfaf06da6b8046bcfb955040c5e Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 16:18:45 +0100 Subject: [PATCH 12/44] Marketing API devspaces --- .../Marketing.API/Dockerfile.develop | 18 +++++++ .../Marketing/Marketing.API/azds.yaml | 54 +++++++++++++++++++ src/prepare-devspaces.ps1 | 5 ++ 3 files changed, 77 insertions(+) create mode 100644 src/Services/Marketing/Marketing.API/Dockerfile.develop create mode 100644 src/Services/Marketing/Marketing.API/azds.yaml diff --git a/src/Services/Marketing/Marketing.API/Dockerfile.develop b/src/Services/Marketing/Marketing.API/Dockerfile.develop new file mode 100644 index 000000000..60fc6dd7c --- /dev/null +++ b/src/Services/Marketing/Marketing.API/Dockerfile.develop @@ -0,0 +1,18 @@ +FROM microsoft/dotnet:2.2-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/Services/Marketing/Marketing.API/Marketing.API.csproj", "src/Services/Marketing/Marketing.API/"] +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +RUN dotnet restore src/Services/Marketing/Marketing.API/Marketing.API.csproj -nowarn:msb3202,nu1503 +COPY . . +WORKDIR "/src/src/Services/Marketing/Marketing.API" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] diff --git a/src/Services/Marketing/Marketing.API/azds.yaml b/src/Services/Marketing/Marketing.API/azds.yaml new file mode 100644 index 000000000..b3f82709c --- /dev/null +++ b/src/Services/Marketing/Marketing.API/azds.yaml @@ -0,0 +1,54 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/marketing-api + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + # This expands to [space.s.]identity...aksapp.io + - $(spacePrefix)marketing-api$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: Dockerfile.develop + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${BUILD_CONFIGURATION:-Debug} + iterate: + processesToKill: + - dotnet + - vsdbg + buildCommands: + - - dotnet + - build + - --no-restore + - -c + - ${BUILD_CONFIGURATION:-Debug} diff --git a/src/prepare-devspaces.ps1 b/src/prepare-devspaces.ps1 index e79dbd4ab..11dcebc06 100644 --- a/src/prepare-devspaces.ps1 +++ b/src/prepare-devspaces.ps1 @@ -41,6 +41,11 @@ Write-Host "Copying app.yaml and inf.yaml to Locations API" -ForegroundColor Yel Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Location\Locations.API" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Location\Locations.API" -Force +Write-Host "Copying app.yaml and inf.yaml to Marketing API" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Marketing\Marketing.API" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Marketing\Marketing.API" -Force + + Write-Host "Copying app.yaml and inf.yaml to WebMVC" -ForegroundColor Yellow Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Web\WebMVC" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Web\WebMVC" -Force From f94a5612335fbea0d10a35092b3e759d5d54cffe Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 16:25:35 +0100 Subject: [PATCH 13/44] Ordering API devspaces --- .../Ordering/Ordering.API/Dockerfile.develop | 7 +-- src/Services/Ordering/Ordering.API/app.yaml | 43 ----------------- src/Services/Ordering/Ordering.API/azds.yaml | 47 ++++++++++++------- src/Services/Ordering/Ordering.API/inf.yaml | 22 --------- src/prepare-devspaces.ps1 | 4 ++ 5 files changed, 35 insertions(+), 88 deletions(-) delete mode 100644 src/Services/Ordering/Ordering.API/app.yaml delete mode 100644 src/Services/Ordering/Ordering.API/inf.yaml diff --git a/src/Services/Ordering/Ordering.API/Dockerfile.develop b/src/Services/Ordering/Ordering.API/Dockerfile.develop index 01b1e58c1..f91a71bd8 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile.develop +++ b/src/Services/Ordering/Ordering.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.2.100-sdk +FROM microsoft/dotnet:2.2-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true @@ -9,9 +9,6 @@ COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlock COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] COPY ["src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj", "src/Services/Ordering/Ordering.Domain/"] COPY ["src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj", "src/Services/Ordering/Ordering.Infrastructure/"] @@ -22,4 +19,4 @@ COPY . . WORKDIR /src/src/Services/Ordering/Ordering.API RUN dotnet build --no-restore -c $BUILD_CONFIGURATION -CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/app.yaml b/src/Services/Ordering/Ordering.API/app.yaml deleted file mode 100644 index 6ca5d9d31..000000000 --- a/src/Services/Ordering/Ordering.API/app.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# This heml values file defines app-based settings -# Charts use those values, so this file **MUST** be included in all chart releases - - -app: # app global settings - name: "my-eshop" # Override for custom app name - ingress: # ingress related settings - entries: - basket: basket-api # ingress entry for basket api - catalog: catalog-api # ingress entry for catalog api - ordering: ordering-api # ingress entry for ordering api - identity: identity # ingress entry for identity api - mvc: webmvc # ingress entry for web mvc - spa: "" # ingress entry for web spa - status: webstatus # ingress entry for web status - webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw - webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw - mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw - webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator - mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator - payment: payment-api # ingress entry for payment api - locations: locations-api # ingress entry for locations api - marketing: marketing-api # ingress entry for marketing api - svc: - basket: basket # service name for basket api - catalog: catalog # service name for catalog api - ordering: ordering # service name for ordering api - orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks - orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub - identity: identity # service name for identity api - mvc: webmvc # service name for web mvc - spa: webspa # service name for web spa - status: webstatus # service name for web status - webshoppingapigw: webshoppingapigw # service name for web shopping Agw - webmarketingapigw: webmarketingapigw # service name for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw - mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw - webshoppingagg: webshoppingagg # service name for web shopping aggregator - mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator - payment: payment # service name for payment api - locations: locations # service name for locations api - marketing: marketing # service name for marketing ap diff --git a/src/Services/Ordering/Ordering.API/azds.yaml b/src/Services/Ordering/Ordering.API/azds.yaml index b81f9d773..39f2477b0 100644 --- a/src/Services/Ordering/Ordering.API/azds.yaml +++ b/src/Services/Ordering/Ordering.API/azds.yaml @@ -1,43 +1,54 @@ kind: helm-release -apiVersion: 1.0 +apiVersion: 1.1 build: context: ..\..\..\.. dockerfile: Dockerfile install: chart: ../../../../k8s/helm/ordering-api - values: - - values.dev.yaml? - - secrets.dev.yaml? - - inf.yaml - - app.yaml - set: replicaCount: 1 image: tag: $(tag) pullPolicy: Never - inf: - k8s: - dns: "$(spacePrefix)orderingapi$(hostSuffix)" ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]orderingapi...aksapp.io - $(spacePrefix)orderingapi$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml configurations: develop: build: - dockerfile: Dockerfile.develop useGitIgnore: true + dockerfile: Dockerfile.develop args: BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} container: sync: - - "**/Pages/**" - - "**/Views/**" - - "**/wwwroot/**" - - "!**/*.{sln,csproj}" - command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${BUILD_CONFIGURATION:-Debug} iterate: - processesToKill: [dotnet, vsdbg] + processesToKill: + - dotnet + - vsdbg buildCommands: - - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] + - - dotnet + - build + - --no-restore + - -c + - ${BUILD_CONFIGURATION:-Debug} diff --git a/src/Services/Ordering/Ordering.API/inf.yaml b/src/Services/Ordering/Ordering.API/inf.yaml deleted file mode 100644 index 943ec99fb..000000000 --- a/src/Services/Ordering/Ordering.API/inf.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# This heml values file defines all infrastructure used by eShopOnContainers. -# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment - -inf: - sql: # inf.sql defines the sql server databases & logins -# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used - common: - user: sa # SQL user - pwd: Pass@word # SQL pwd - pid: Developer - ordering: # inf.sql.ordering: settings for the ordering-api sql (user, pwd, db) - db: OrderingDb # Ordering API SQL db name - eventbus: - svc: rabbitmq # Name of k8s svc for rabbitmq - constr: rabbitmq # Event bus connection string - useAzure: false # true if use Azure Service Bus. False if RabbitMQ - appinsights: - key: "" # App insights to use - k8s: {} - misc: # inf.misc contains miscellaneous configuration related to infrastructure - useLoadTest: false # If running under loading test or not - useAzureStorage: false # If catalog api uses azure storage or not diff --git a/src/prepare-devspaces.ps1 b/src/prepare-devspaces.ps1 index 11dcebc06..b946168da 100644 --- a/src/prepare-devspaces.ps1 +++ b/src/prepare-devspaces.ps1 @@ -45,6 +45,10 @@ Write-Host "Copying app.yaml and inf.yaml to Marketing API" -ForegroundColor Yel Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Marketing\Marketing.API" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Marketing\Marketing.API" -Force +Write-Host "Copying app.yaml and inf.yaml to Ordering API" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.API" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.API" -Force + Write-Host "Copying app.yaml and inf.yaml to WebMVC" -ForegroundColor Yellow Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Web\WebMVC" -Force From 95f8b8370e21471688c3e71c45a65dc14168dc0c Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 16:29:55 +0100 Subject: [PATCH 14/44] Payment API devspaces --- .../Payment/Payment.API/Dockerfile.develop | 19 +++++++ src/Services/Payment/Payment.API/azds.yaml | 54 +++++++++++++++++++ src/prepare-devspaces.ps1 | 3 ++ 3 files changed, 76 insertions(+) create mode 100644 src/Services/Payment/Payment.API/Dockerfile.develop create mode 100644 src/Services/Payment/Payment.API/azds.yaml diff --git a/src/Services/Payment/Payment.API/Dockerfile.develop b/src/Services/Payment/Payment.API/Dockerfile.develop new file mode 100644 index 000000000..4b959f4b3 --- /dev/null +++ b/src/Services/Payment/Payment.API/Dockerfile.develop @@ -0,0 +1,19 @@ +FROM microsoft/dotnet:2.2-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] +COPY ["src/Services/Payment/Payment.API/Payment.API.csproj", "src/Services/Payment/Payment.API/"] + +RUN dotnet restore src/Services/Payment/Payment.API/Payment.API.csproj +COPY . . +WORKDIR /src/src/Services/Payment/Payment.API +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Services/Payment/Payment.API/azds.yaml b/src/Services/Payment/Payment.API/azds.yaml new file mode 100644 index 000000000..a3e434ca2 --- /dev/null +++ b/src/Services/Payment/Payment.API/azds.yaml @@ -0,0 +1,54 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/payment-api + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + # This expands to [space.s.]paymentapi...aksapp.io + - $(spacePrefix)paymentapi$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: Dockerfile.develop + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${BUILD_CONFIGURATION:-Debug} + iterate: + processesToKill: + - dotnet + - vsdbg + buildCommands: + - - dotnet + - build + - --no-restore + - -c + - ${BUILD_CONFIGURATION:-Debug} diff --git a/src/prepare-devspaces.ps1 b/src/prepare-devspaces.ps1 index b946168da..83c4fb52c 100644 --- a/src/prepare-devspaces.ps1 +++ b/src/prepare-devspaces.ps1 @@ -49,6 +49,9 @@ Write-Host "Copying app.yaml and inf.yaml to Ordering API" -ForegroundColor Yell Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.API" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.API" -Force +Write-Host "Copying app.yaml and inf.yaml to Payment API" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Payment\Payment.API" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Payment\Payment.API" -Force Write-Host "Copying app.yaml and inf.yaml to WebMVC" -ForegroundColor Yellow Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Web\WebMVC" -Force From b2252dc4ec5044d83b78b5e440fa39a5971ee90d Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 16:48:41 +0100 Subject: [PATCH 15/44] Webhooks api Devspaces --- k8s/helm/webhooks-api/templates/ingress.yaml | 7 ++- .../Webhooks/Webhooks.API/Dockerfile.develop | 21 ++++++++ src/Services/Webhooks/Webhooks.API/azds.yaml | 52 +++++++++++++++++++ src/prepare-devspaces.ps1 | 4 ++ 4 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 src/Services/Webhooks/Webhooks.API/Dockerfile.develop create mode 100644 src/Services/Webhooks/Webhooks.API/azds.yaml diff --git a/k8s/helm/webhooks-api/templates/ingress.yaml b/k8s/helm/webhooks-api/templates/ingress.yaml index 293f8e47e..debf0f84a 100644 --- a/k8s/helm/webhooks-api/templates/ingress.yaml +++ b/k8s/helm/webhooks-api/templates/ingress.yaml @@ -1,5 +1,6 @@ {{- if .Values.ingress.enabled -}} {{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.webhooks }} apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -23,11 +24,13 @@ spec: {{- end }} {{- end }} rules: - - host: {{ .Values.inf.k8s.dns }} + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ .Values.app.svc.webhooks }} + serviceName: {{ $serviceName }} servicePort: http + {{- end }} {{- end }} diff --git a/src/Services/Webhooks/Webhooks.API/Dockerfile.develop b/src/Services/Webhooks/Webhooks.API/Dockerfile.develop new file mode 100644 index 000000000..82209495c --- /dev/null +++ b/src/Services/Webhooks/Webhooks.API/Dockerfile.develop @@ -0,0 +1,21 @@ +FROM microsoft/dotnet:2.2-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src + +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +COPY ["src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj", "src/Services/Webhooks/Webhooks.API/"] + +RUN dotnet restore src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj -nowarn:msb3202,nu1503 +COPY . . +WORKDIR "/src/src/Services/Webhooks/Webhooks.API" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Services/Webhooks/Webhooks.API/azds.yaml b/src/Services/Webhooks/Webhooks.API/azds.yaml new file mode 100644 index 000000000..f9d63ff21 --- /dev/null +++ b/src/Services/Webhooks/Webhooks.API/azds.yaml @@ -0,0 +1,52 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/webhooks-api + set: + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + # This expands to [space.s.]webhooksapi...aksapp.io + - $(spacePrefix)webhooksapi$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: Dockerfile.develop + container: + syncTarget: /src + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${Configuration:-Debug} + iterate: + processesToKill: + - dotnet + - vsdbg + buildCommands: + - - dotnet + - build + - --no-restore + - -c + - ${Configuration:-Debug} diff --git a/src/prepare-devspaces.ps1 b/src/prepare-devspaces.ps1 index 83c4fb52c..14b1cc6d1 100644 --- a/src/prepare-devspaces.ps1 +++ b/src/prepare-devspaces.ps1 @@ -53,6 +53,10 @@ Write-Host "Copying app.yaml and inf.yaml to Payment API" -ForegroundColor Yello Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Payment\Payment.API" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Payment\Payment.API" -Force +Write-Host "Copying app.yaml and inf.yaml to Webhooks API" -ForegroundColor Yellow +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Webhooks\Webhooks.API" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Webhooks\Webhooks.API" -Force + Write-Host "Copying app.yaml and inf.yaml to WebMVC" -ForegroundColor Yellow Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Web\WebMVC" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Web\WebMVC" -Force From fbaaa8c450552f85257d481f08c4d4d731c7e67f Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 18:04:49 +0100 Subject: [PATCH 16/44] devspaces source code support integrated in webmvc --- eShopOnContainers-ServicesAndWebApps.sln | 58 ++++++++++++++++++- .../Devspaces.Support.csproj | 11 ++++ .../DevspacesMessageHandler.cs | 30 ++++++++++ .../HttpClientBuilderDevspacesExtensions.cs | 16 +++++ .../ServiceCollectionDevspacesExtensions.cs | 16 +++++ src/Web/WebMVC/Dockerfile.develop | 1 + src/Web/WebMVC/Startup.cs | 21 ++++--- src/Web/WebMVC/WebMVC.csproj | 4 ++ 8 files changed, 148 insertions(+), 9 deletions(-) create mode 100644 src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj create mode 100644 src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs create mode 100644 src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs create mode 100644 src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs diff --git a/eShopOnContainers-ServicesAndWebApps.sln b/eShopOnContainers-ServicesAndWebApps.sln index 447b73073..882bca09f 100644 --- a/eShopOnContainers-ServicesAndWebApps.sln +++ b/eShopOnContainers-ServicesAndWebApps.sln @@ -142,9 +142,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Payment.API", "src\Services EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Webhooks", "Webhooks", "{E0AA11C4-2873-461D-8F82-53392530FB7A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Webhooks.API", "src\Services\Webhooks\Webhooks.API\Webhooks.API.csproj", "{84E2016E-0435-44C6-8020-3D288AA38B2C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Webhooks.API", "src\Services\Webhooks\Webhooks.API\Webhooks.API.csproj", "{84E2016E-0435-44C6-8020-3D288AA38B2C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebhookClient", "src\Web\WebhookClient\WebhookClient.csproj", "{766D7E92-6AF0-476C-ADD5-282BF4D8C576}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebhookClient", "src\Web\WebhookClient\WebhookClient.csproj", "{766D7E92-6AF0-476C-ADD5-282BF4D8C576}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Devspace.Support", "Devspace.Support", "{68F5041D-51F2-4630-94B6-B49789F5E51A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Devspaces.Support", "src\BuildingBlocks\Devspaces.Support\Devspaces.Support.csproj", "{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1744,6 +1748,54 @@ Global {766D7E92-6AF0-476C-ADD5-282BF4D8C576}.Release|x64.Build.0 = Release|Any CPU {766D7E92-6AF0-476C-ADD5-282BF4D8C576}.Release|x86.ActiveCfg = Release|Any CPU {766D7E92-6AF0-476C-ADD5-282BF4D8C576}.Release|x86.Build.0 = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|ARM.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|iPhone.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|x64.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|x64.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|x86.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|x86.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|ARM.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|ARM.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|iPhone.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|x64.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|x64.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|x86.ActiveCfg = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|x86.Build.0 = Debug|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|Any CPU.Build.0 = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|ARM.ActiveCfg = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|ARM.Build.0 = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|iPhone.ActiveCfg = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|iPhone.Build.0 = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|x64.ActiveCfg = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|x64.Build.0 = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|x86.ActiveCfg = Release|Any CPU + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1808,6 +1860,8 @@ Global {E0AA11C4-2873-461D-8F82-53392530FB7A} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8} {84E2016E-0435-44C6-8020-3D288AA38B2C} = {E0AA11C4-2873-461D-8F82-53392530FB7A} {766D7E92-6AF0-476C-ADD5-282BF4D8C576} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04} + {68F5041D-51F2-4630-94B6-B49789F5E51A} = {DB0EFB20-B024-4E5E-A75C-52143C131D25} + {56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35} = {68F5041D-51F2-4630-94B6-B49789F5E51A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9} diff --git a/src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj b/src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj new file mode 100644 index 000000000..81a897bad --- /dev/null +++ b/src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj @@ -0,0 +1,11 @@ + + + + netstandard2.0 + + + + + + + diff --git a/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs b/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs new file mode 100644 index 000000000..0895b752a --- /dev/null +++ b/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs @@ -0,0 +1,30 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Devspaces.Support +{ + public class DevspacesMessageHandler : DelegatingHandler + { + private const string DevspacesHeaderName = "azds-route-as"; + private readonly IHttpContextAccessor _httpContextAccessor; + public DevspacesMessageHandler(IHttpContextAccessor httpContextAccessor) + { + _httpContextAccessor = httpContextAccessor; + } + + protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + var req = _httpContextAccessor.HttpContext.Request; + + if (req.Headers.ContainsKey(DevspacesHeaderName)) + { + request.Headers.Add(DevspacesHeaderName, req.Headers[DevspacesHeaderName] as IEnumerable); + } + return base.SendAsync(request, cancellationToken); + } + } +} diff --git a/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs b/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs new file mode 100644 index 000000000..60108301d --- /dev/null +++ b/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Devspaces.Support +{ + public static class HttpClientBuilderDevspacesExtensions + { + public static IHttpClientBuilder AddDevspacesSupport(this IHttpClientBuilder builder) + { + builder.AddHttpMessageHandler(); + return builder; + } + } +} diff --git a/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs b/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs new file mode 100644 index 000000000..0ac5c9e1b --- /dev/null +++ b/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Devspaces.Support +{ + public static class ServiceCollectionDevspacesExtensions + { + public static IServiceCollection AddDevspaces(this IServiceCollection services) + { + services.AddTransient(); + return services; + } + } +} diff --git a/src/Web/WebMVC/Dockerfile.develop b/src/Web/WebMVC/Dockerfile.develop index 7e923c2b4..6ff9cc869 100644 --- a/src/Web/WebMVC/Dockerfile.develop +++ b/src/Web/WebMVC/Dockerfile.develop @@ -6,6 +6,7 @@ EXPOSE 80 WORKDIR /src COPY ["src/Web/WebMVC/WebMVC.csproj", "src/Web/WebMVC/"] +COPY ["src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj", "src/BuildingBlocks/Devspaces.Support/"] RUN dotnet restore "src/Web/WebMVC/WebMVC.csproj" COPY . . WORKDIR "/src/src/Web/WebMVC" diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index d69b21459..28da98e84 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -1,4 +1,5 @@ -using HealthChecks.UI.Client; +using Devspaces.Support; +using HealthChecks.UI.Client; using Microsoft.ApplicationInsights.Extensibility; using Microsoft.ApplicationInsights.ServiceFabric; using Microsoft.AspNetCore.Authentication.Cookies; @@ -42,6 +43,7 @@ namespace Microsoft.eShopOnContainers.WebMVC services.AddAppInsight(Configuration) .AddHealthChecks(Configuration) .AddCustomMvc(Configuration) + .AddDevspaces() .AddHttpClientServices(Configuration) //.AddHttpClientLogging(Configuration) //Opt-in HttpClientLogging config .AddCustomAuthentication(Configuration); @@ -177,34 +179,39 @@ namespace Microsoft.eShopOnContainers.WebMVC services.AddTransient(); //set 5 min as the lifetime for each HttpMessageHandler int the pool - services.AddHttpClient("extendedhandlerlifetime").SetHandlerLifetime(TimeSpan.FromMinutes(5)); + services.AddHttpClient("extendedhandlerlifetime").SetHandlerLifetime(TimeSpan.FromMinutes(5)).AddDevspacesSupport(); //add http client services services.AddHttpClient() .SetHandlerLifetime(TimeSpan.FromMinutes(5)) //Sample. Default lifetime is 2 minutes .AddHttpMessageHandler() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); services.AddHttpClient() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); services.AddHttpClient() .AddHttpMessageHandler() .AddHttpMessageHandler() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); services.AddHttpClient() .AddHttpMessageHandler() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); services.AddHttpClient() .AddHttpMessageHandler() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); //add custom application services services.AddTransient, IdentityParser>(); diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index 5e5643c63..f4d91fd15 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -52,4 +52,8 @@ + + + + From dbfc5081d69f4cf410d09ccaca3bde7c2fc8735f Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 18:12:02 +0100 Subject: [PATCH 17/44] Webhooks API devspaces source code support --- src/Services/Webhooks/Webhooks.API/Dockerfile.develop | 1 + src/Services/Webhooks/Webhooks.API/Startup.cs | 6 ++++-- src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Services/Webhooks/Webhooks.API/Dockerfile.develop b/src/Services/Webhooks/Webhooks.API/Dockerfile.develop index 82209495c..3cc1084f9 100644 --- a/src/Services/Webhooks/Webhooks.API/Dockerfile.develop +++ b/src/Services/Webhooks/Webhooks.API/Dockerfile.develop @@ -11,6 +11,7 @@ COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "s COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +COPY ["src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj", "src/BuildingBlocks/Devspaces.Support/"] COPY ["src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj", "src/Services/Webhooks/Webhooks.API/"] RUN dotnet restore src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj -nowarn:msb3202,nu1503 diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index ba3ccfe3d..758b5df47 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using Autofac; using Autofac.Extensions.DependencyInjection; +using Devspaces.Support; using HealthChecks.UI.Client; using Microsoft.ApplicationInsights.Extensibility; using Microsoft.ApplicationInsights.ServiceFabric; @@ -55,6 +56,7 @@ namespace Webhooks.API .AddCustomDbContext(Configuration) .AddSwagger(Configuration) .AddCustomHealthCheck(Configuration) + .AddDevspaces() .AddHttpClientServices(Configuration) .AddIntegrationServices(Configuration) .AddEventBus(Configuration) @@ -294,8 +296,8 @@ namespace Webhooks.API services.AddHttpClient("extendedhandlerlifetime").SetHandlerLifetime(Timeout.InfiniteTimeSpan); //add http client services services.AddHttpClient("GrantClient") - .SetHandlerLifetime(TimeSpan.FromMinutes(5)); - //.AddHttpMessageHandler(); + .SetHandlerLifetime(TimeSpan.FromMinutes(5)) + .AddDevspacesSupport(); return services; } diff --git a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj index c054e75e7..61f415573 100644 --- a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj +++ b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj @@ -22,6 +22,7 @@ + From 40205f066a30262c95c461b381e5483353c676e7 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 18:21:31 +0100 Subject: [PATCH 18/44] HTTP Aggreggators devspace source code support --- .../aggregator/Dockerfile.develop | 1 + .../Mobile.Shopping.HttpAggregator.csproj | 4 ++++ .../Mobile.Bff.Shopping/aggregator/Startup.cs | 11 ++++++++--- .../Web.Bff.Shopping/aggregator/Dockerfile.develop | 1 + .../Web.Bff.Shopping/aggregator/Startup.cs | 14 +++++++++----- .../aggregator/Web.Shopping.HttpAggregator.csproj | 4 ++++ 6 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop index 16d42e393..c4330c370 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -6,6 +6,7 @@ EXPOSE 80 WORKDIR /src COPY ["src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj", "src/ApiGateways/Mobile.Bff.Shopping/aggregator/"] +COPY ["src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj", "src/BuildingBlocks/Devspaces.Support/"] RUN dotnet restore src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj -nowarn:msb3202,nu1503 COPY . . diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj index 6300d6711..70bbefa2d 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj @@ -23,4 +23,8 @@ + + + + diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs index eeb58ac3b..53ebbb2e4 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs @@ -20,6 +20,7 @@ using Swashbuckle.AspNetCore.Swagger; using HealthChecks.UI.Client; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.Extensions.Diagnostics.HealthChecks; +using Devspaces.Support; namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator { @@ -47,6 +48,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator services.AddCustomMvc(Configuration) .AddCustomAuthentication(Configuration) + .AddDevspaces() .AddHttpServices(); } @@ -188,15 +190,18 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator services.AddHttpClient() .AddHttpMessageHandler() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); services.AddHttpClient() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); services.AddHttpClient() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); return services; } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop index c5c80af40..3d0d16dd3 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop @@ -6,6 +6,7 @@ EXPOSE 80 WORKDIR /src COPY ["src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj", "src/ApiGateways/Web.Bff.Shopping/aggregator/"] +COPY ["src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj", "src/BuildingBlocks/Devspaces.Support/"] RUN dotnet restore src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj -nowarn:msb3202,nu1503 COPY . . diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs index 0fcd13a41..189379f54 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs @@ -21,6 +21,7 @@ using System.Net.Http; using HealthChecks.UI.Client; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.Extensions.Diagnostics.HealthChecks; +using Devspaces.Support; namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator { @@ -48,6 +49,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator services.AddCustomMvc(Configuration) .AddCustomAuthentication(Configuration) + .AddDevspaces() .AddApplicationServices(); } @@ -182,21 +184,23 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator services.AddSingleton(); //register http services - + services.AddHttpClient() .AddHttpMessageHandler() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); services.AddHttpClient() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); services.AddHttpClient() .AddHttpMessageHandler() .AddPolicyHandler(GetRetryPolicy()) - .AddPolicyHandler(GetCircuitBreakerPolicy()); - + .AddPolicyHandler(GetCircuitBreakerPolicy()) + .AddDevspacesSupport(); return services; } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj index de2f55ab8..436f04825 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj @@ -22,4 +22,8 @@ + + + + From 1f762a6bcfcb3d46c86353e6b133190d39e0bec2 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Fri, 15 Mar 2019 19:52:34 +0100 Subject: [PATCH 19/44] devspaces scripts --- k8s/helm/apigwmm/templates/_names.tpl | 11 +++--- k8s/helm/apigwmm/templates/deployment.yaml | 2 +- k8s/helm/apigwmm/templates/ingress.yaml | 2 +- k8s/helm/apigwms/templates/_names.tpl | 10 ++--- k8s/helm/apigwms/templates/deployment.yaml | 4 +- k8s/helm/apigwms/templates/ingress.yaml | 10 +++-- k8s/helm/apigwwm/templates/_names.tpl | 10 ++--- k8s/helm/apigwwm/templates/deployment.yaml | 4 +- k8s/helm/apigwwm/templates/ingress.yaml | 10 +++-- k8s/helm/apigwws/templates/_names.tpl | 11 +++--- k8s/helm/apigwws/templates/deployment.yaml | 4 +- k8s/helm/apigwws/templates/ingress.yaml | 9 +++-- k8s/helm/apigwws/values.yaml | 2 + k8s/helm/basket-api/templates/ingress.yaml | 37 +++++++++++++++++++ k8s/helm/basket-api/values.yaml | 3 ++ k8s/helm/catalog-api/templates/ingress.yaml | 37 +++++++++++++++++++ .../identity-api/templates/configmap.yaml | 3 +- k8s/helm/identity-api/values.yaml | 7 +++- k8s/helm/locations-api/templates/ingress.yaml | 36 ++++++++++++++++++ k8s/helm/marketing-api/templates/ingress.yaml | 36 ++++++++++++++++++ .../mobileshoppingagg/templates/ingress.yaml | 36 ++++++++++++++++++ .../webshoppingagg/templates/ingress.yaml | 36 ++++++++++++++++++ .../Mobile.Bff.Marketing/apigw/azds.yaml | 6 +-- .../aggregator/values.dev.yaml | 3 ++ .../Mobile.Bff.Shopping/apigw/azds.yaml | 2 +- .../Web.Bff.Marketing/apigw/azds.yaml | 6 +-- .../aggregator/values.dev.yaml | 2 + .../Basket/Basket.API/values.dev.yaml | 3 ++ .../Catalog/Catalog.API/values.dev.yaml | 3 ++ .../DevspacesRedirectUriValidator.cs | 31 ++++++++++++++++ .../IdentityDevspacesBuilderExtensions.cs | 20 ++++++++++ src/Services/Identity/Identity.API/Startup.cs | 2 + .../Identity/Identity.API/values.dev.yaml | 1 + .../Location/Locations.API/values.dev.yaml | 3 ++ .../Marketing/Marketing.API/values.dev.yaml | 3 ++ src/Web/WebMVC/azds.yaml | 3 ++ 36 files changed, 357 insertions(+), 51 deletions(-) create mode 100644 k8s/helm/basket-api/templates/ingress.yaml create mode 100644 k8s/helm/catalog-api/templates/ingress.yaml create mode 100644 k8s/helm/locations-api/templates/ingress.yaml create mode 100644 k8s/helm/marketing-api/templates/ingress.yaml create mode 100644 k8s/helm/mobileshoppingagg/templates/ingress.yaml create mode 100644 k8s/helm/webshoppingagg/templates/ingress.yaml create mode 100644 src/ApiGateways/Mobile.Bff.Shopping/aggregator/values.dev.yaml create mode 100644 src/ApiGateways/Web.Bff.Shopping/aggregator/values.dev.yaml create mode 100644 src/Services/Basket/Basket.API/values.dev.yaml create mode 100644 src/Services/Catalog/Catalog.API/values.dev.yaml create mode 100644 src/Services/Identity/Identity.API/Devspaces/DevspacesRedirectUriValidator.cs create mode 100644 src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs create mode 100644 src/Services/Identity/Identity.API/values.dev.yaml create mode 100644 src/Services/Location/Locations.API/values.dev.yaml create mode 100644 src/Services/Marketing/Marketing.API/values.dev.yaml diff --git a/k8s/helm/apigwmm/templates/_names.tpl b/k8s/helm/apigwmm/templates/_names.tpl index a6eeb9965..d44859fea 100644 --- a/k8s/helm/apigwmm/templates/_names.tpl +++ b/k8s/helm/apigwmm/templates/_names.tpl @@ -33,14 +33,13 @@ {{- end -}} + {{- define "pathBase" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if $ctx.Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" $ctx -}} -{{- printf "/%s-%s" $name $suffix -}} +{{- if .Values.inf.k8s.suffix -}} +{{- $suffix := include "suffix-name" . -}} +{{- printf "%s-%s" .Values.pathBase $suffix -}} {{- else -}} -{{- printf "/%s" $name -}} +{{- .Values.pathBase -}} {{- end -}} {{- end -}} diff --git a/k8s/helm/apigwmm/templates/deployment.yaml b/k8s/helm/apigwmm/templates/deployment.yaml index 46e5bee24..c9abb0b62 100644 --- a/k8s/helm/apigwmm/templates/deployment.yaml +++ b/k8s/helm/apigwmm/templates/deployment.yaml @@ -64,7 +64,7 @@ spec: mountPath: {{ .Values.ocelot.configPath }} env: - name: PATH_BASE - value: {{ include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) }} + value: {{ include "pathBase" . }} - name: k8sname value: {{ .Values.clusterName }} {{- if .Values.env.values -}} diff --git a/k8s/helm/apigwmm/templates/ingress.yaml b/k8s/helm/apigwmm/templates/ingress.yaml index ec6d078bd..290aac0b3 100644 --- a/k8s/helm/apigwmm/templates/ingress.yaml +++ b/k8s/helm/apigwmm/templates/ingress.yaml @@ -1,5 +1,5 @@ {{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) -}} +{{- $ingressPath := include "pathBase" . -}} {{- $serviceName := .Values.app.svc.mobilemarketingapigw -}} apiVersion: extensions/v1beta1 kind: Ingress diff --git a/k8s/helm/apigwms/templates/_names.tpl b/k8s/helm/apigwms/templates/_names.tpl index 1e840c56c..d44859fea 100644 --- a/k8s/helm/apigwms/templates/_names.tpl +++ b/k8s/helm/apigwms/templates/_names.tpl @@ -35,13 +35,11 @@ {{- define "pathBase" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if $ctx.Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" $ctx -}} -{{- printf "/%s-%s" $name $suffix -}} +{{- if .Values.inf.k8s.suffix -}} +{{- $suffix := include "suffix-name" . -}} +{{- printf "%s-%s" .Values.pathBase $suffix -}} {{- else -}} -{{- printf "/%s" $name -}} +{{- .Values.pathBase -}} {{- end -}} {{- end -}} diff --git a/k8s/helm/apigwms/templates/deployment.yaml b/k8s/helm/apigwms/templates/deployment.yaml index 65522e986..b22922f89 100644 --- a/k8s/helm/apigwms/templates/deployment.yaml +++ b/k8s/helm/apigwms/templates/deployment.yaml @@ -61,10 +61,10 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: config - mountPath: {{ .Values ocelot.configPath }} + mountPath: {{ .Values.ocelot.configPath }} env: - name: PATH_BASE - value: {{ include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) }} + value: {{ include "pathBase" . }} - name: k8sname value: {{ .Values.clusterName }} {{- if .Values.env.values -}} diff --git a/k8s/helm/apigwms/templates/ingress.yaml b/k8s/helm/apigwms/templates/ingress.yaml index 7dd50d8dd..e93ddc2c6 100644 --- a/k8s/helm/apigwms/templates/ingress.yaml +++ b/k8s/helm/apigwms/templates/ingress.yaml @@ -1,5 +1,7 @@ {{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.mobileshoppingapigw -}} + apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -23,11 +25,13 @@ spec: {{- end }} {{- end }} rules: - - host: {{ .Values.inf.k8s.dns }} + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ .Values.app.svc.mobileshoppingapigw }} + serviceName: {{ $serviceName }} servicePort: http + {{- end }} {{- end }} diff --git a/k8s/helm/apigwwm/templates/_names.tpl b/k8s/helm/apigwwm/templates/_names.tpl index 1e840c56c..d44859fea 100644 --- a/k8s/helm/apigwwm/templates/_names.tpl +++ b/k8s/helm/apigwwm/templates/_names.tpl @@ -35,13 +35,11 @@ {{- define "pathBase" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if $ctx.Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" $ctx -}} -{{- printf "/%s-%s" $name $suffix -}} +{{- if .Values.inf.k8s.suffix -}} +{{- $suffix := include "suffix-name" . -}} +{{- printf "%s-%s" .Values.pathBase $suffix -}} {{- else -}} -{{- printf "/%s" $name -}} +{{- .Values.pathBase -}} {{- end -}} {{- end -}} diff --git a/k8s/helm/apigwwm/templates/deployment.yaml b/k8s/helm/apigwwm/templates/deployment.yaml index 4f02bc2e9..d1f39ab6c 100644 --- a/k8s/helm/apigwwm/templates/deployment.yaml +++ b/k8s/helm/apigwwm/templates/deployment.yaml @@ -61,10 +61,10 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: config - mountPath: {{ .Values ocelot.configPath }} + mountPath: {{ .Values.ocelot.configPath }} env: - name: PATH_BASE - value: {{ include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) }} + value: {{ include "pathBase" . }} - name: k8sname value: {{ .Values.clusterName }} {{- if .Values.env.values -}} diff --git a/k8s/helm/apigwwm/templates/ingress.yaml b/k8s/helm/apigwwm/templates/ingress.yaml index 0a79c4660..297fea52b 100644 --- a/k8s/helm/apigwwm/templates/ingress.yaml +++ b/k8s/helm/apigwwm/templates/ingress.yaml @@ -1,5 +1,7 @@ {{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.webmarketingapigw -}} + apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -23,11 +25,13 @@ spec: {{- end }} {{- end }} rules: - - host: {{ .Values.inf.k8s.dns }} + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ .Values.app.svc.webmarketingapigw }} + serviceName: {{ $serviceName }} servicePort: http + {{- end }} {{- end }} diff --git a/k8s/helm/apigwws/templates/_names.tpl b/k8s/helm/apigwws/templates/_names.tpl index a6eeb9965..d44859fea 100644 --- a/k8s/helm/apigwws/templates/_names.tpl +++ b/k8s/helm/apigwws/templates/_names.tpl @@ -33,14 +33,13 @@ {{- end -}} + {{- define "pathBase" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if $ctx.Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" $ctx -}} -{{- printf "/%s-%s" $name $suffix -}} +{{- if .Values.inf.k8s.suffix -}} +{{- $suffix := include "suffix-name" . -}} +{{- printf "%s-%s" .Values.pathBase $suffix -}} {{- else -}} -{{- printf "/%s" $name -}} +{{- .Values.pathBase -}} {{- end -}} {{- end -}} diff --git a/k8s/helm/apigwws/templates/deployment.yaml b/k8s/helm/apigwws/templates/deployment.yaml index 4912d12bb..327eb50b7 100644 --- a/k8s/helm/apigwws/templates/deployment.yaml +++ b/k8s/helm/apigwws/templates/deployment.yaml @@ -60,10 +60,10 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: config - mountPath: /app/configuration + mountPath: {{ .Values.ocelot.configPath }} env: - name: PATH_BASE - value: {{ include "pathBase" (list .Values.app.ingress.entries.webshoppingapigw .) }} + value: {{ include "pathBase" . }} - name: k8sname value: {{ .Values.clusterName }} {{- if .Values.env.values -}} diff --git a/k8s/helm/apigwws/templates/ingress.yaml b/k8s/helm/apigwws/templates/ingress.yaml index ee1f681ad..8bd2cfc6d 100644 --- a/k8s/helm/apigwws/templates/ingress.yaml +++ b/k8s/helm/apigwws/templates/ingress.yaml @@ -1,5 +1,6 @@ {{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.webshoppingapigw .) -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.webshoppingapigw -}} apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -23,11 +24,13 @@ spec: {{- end }} {{- end }} rules: - - host: {{ .Values.inf.k8s.dns }} + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ .Values.app.svc.webshoppingapigw }} + serviceName: {{ $serviceName }} servicePort: http + {{- end }} {{- end }} diff --git a/k8s/helm/apigwws/values.yaml b/k8s/helm/apigwws/values.yaml index 94b8a203f..2b047de99 100644 --- a/k8s/helm/apigwws/values.yaml +++ b/k8s/helm/apigwws/values.yaml @@ -62,3 +62,5 @@ probes: initialDelaySeconds: 90 periodSeconds: 60 port: 80 +ocelot: + configPath: /app/configuration \ No newline at end of file diff --git a/k8s/helm/basket-api/templates/ingress.yaml b/k8s/helm/basket-api/templates/ingress.yaml new file mode 100644 index 000000000..f99bd55a6 --- /dev/null +++ b/k8s/helm/basket-api/templates/ingress.yaml @@ -0,0 +1,37 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.basket -}} + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "basket-api.fullname" . }} + labels: + app: {{ template "basket-api.name" . }} + chart: {{ template "basket-api.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} \ No newline at end of file diff --git a/k8s/helm/basket-api/values.yaml b/k8s/helm/basket-api/values.yaml index 6c264afba..a773700fe 100644 --- a/k8s/helm/basket-api/values.yaml +++ b/k8s/helm/basket-api/values.yaml @@ -53,3 +53,6 @@ probes: initialDelaySeconds: 90 periodSeconds: 60 port: 80 + +ingress: + enabled: false \ No newline at end of file diff --git a/k8s/helm/catalog-api/templates/ingress.yaml b/k8s/helm/catalog-api/templates/ingress.yaml new file mode 100644 index 000000000..238d7b07e --- /dev/null +++ b/k8s/helm/catalog-api/templates/ingress.yaml @@ -0,0 +1,37 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.catalog -}} + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "catalog-api.fullname" . }} + labels: + app: {{ template "catalog-api.name" . }} + chart: {{ template "catalog-api.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} \ No newline at end of file diff --git a/k8s/helm/identity-api/templates/configmap.yaml b/k8s/helm/identity-api/templates/configmap.yaml index 24d71b699..67c0f21cb 100644 --- a/k8s/helm/identity-api/templates/configmap.yaml +++ b/k8s/helm/identity-api/templates/configmap.yaml @@ -36,5 +36,4 @@ data: xamarin_callback_e: http://{{ $xamarincallback }} webhooksapi_e: http://{{ $webhooks_url }} webhooksweb_e: http://{{ $webhooksweb_url }} - - + enableDevspaces: "{{ .Values.enableDevspaces }}" \ No newline at end of file diff --git a/k8s/helm/identity-api/values.yaml b/k8s/helm/identity-api/values.yaml index c0fd38192..7b57dfde1 100644 --- a/k8s/helm/identity-api/values.yaml +++ b/k8s/helm/identity-api/values.yaml @@ -58,6 +58,8 @@ env: key: webhooksapi_e - name: WebhooksWebClient key: webhooksweb_e + - name: EnableDevspaces + key: enableDevspaces values: - name: ASPNETCORE_ENVIRONMENT value: Development @@ -65,6 +67,7 @@ env: value: 'K8S' - name: IsClusterEnv value: 'True' + probes: liveness: path: /liveness @@ -76,4 +79,6 @@ probes: timeoutSeconds: 5 initialDelaySeconds: 90 periodSeconds: 60 - port: 80 \ No newline at end of file + port: 80 + +enableDevspaces: "false" \ No newline at end of file diff --git a/k8s/helm/locations-api/templates/ingress.yaml b/k8s/helm/locations-api/templates/ingress.yaml new file mode 100644 index 000000000..8c846944e --- /dev/null +++ b/k8s/helm/locations-api/templates/ingress.yaml @@ -0,0 +1,36 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.locations }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "locations-api.fullname" . }} + labels: + app: {{ template "locations-api.name" . }} + chart: {{ template "locations-api.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/k8s/helm/marketing-api/templates/ingress.yaml b/k8s/helm/marketing-api/templates/ingress.yaml new file mode 100644 index 000000000..7a5b29b12 --- /dev/null +++ b/k8s/helm/marketing-api/templates/ingress.yaml @@ -0,0 +1,36 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.marketing }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "marketing-api.fullname" . }} + labels: + app: {{ template "marketing-api.name" . }} + chart: {{ template "marketing-api.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/k8s/helm/mobileshoppingagg/templates/ingress.yaml b/k8s/helm/mobileshoppingagg/templates/ingress.yaml new file mode 100644 index 000000000..6c50a574e --- /dev/null +++ b/k8s/helm/mobileshoppingagg/templates/ingress.yaml @@ -0,0 +1,36 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.mobileshoppingagg }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "mobileshoppingagg.fullname" . }} + labels: + app: {{ template "mobileshoppingagg.name" . }} + chart: {{ template "mobileshoppingagg.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/k8s/helm/webshoppingagg/templates/ingress.yaml b/k8s/helm/webshoppingagg/templates/ingress.yaml new file mode 100644 index 000000000..742db4d30 --- /dev/null +++ b/k8s/helm/webshoppingagg/templates/ingress.yaml @@ -0,0 +1,36 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.webshoppingagg }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "webshoppingagg.fullname" . }} + labels: + app: {{ template "webshoppingagg.name" . }} + chart: {{ template "webshoppingagg.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml b/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml index 85c7a9f64..1dc21a9f1 100644 --- a/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml @@ -2,9 +2,9 @@ kind: helm-release apiVersion: 1.1 build: context: ..\..\..\..\ - dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile + dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile install: - chart: ../../../../k8s/helm/apigwwm + chart: ../../../../k8s/helm/apigwmm set: replicaCount: 1 image: @@ -15,7 +15,7 @@ install: kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]webmvc...aksapp.io - - $(spacePrefix)apigwwm$(hostSuffix) + - $(spacePrefix)apigwmm$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/values.dev.yaml b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/values.dev.yaml new file mode 100644 index 000000000..eaed45149 --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/values.dev.yaml @@ -0,0 +1,3 @@ +ingress: + enabled: true + tls: [] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml index 6e64cf5cf..01a2e36d1 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml @@ -2,7 +2,7 @@ kind: helm-release apiVersion: 1.1 build: context: ..\..\..\..\ - dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile + dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile install: chart: ../../../../k8s/helm/apigwms set: diff --git a/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml b/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml index 4d36cad78..a0972d1f4 100644 --- a/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml +++ b/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml @@ -2,9 +2,9 @@ kind: helm-release apiVersion: 1.1 build: context: ..\..\..\..\ - dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile + dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile install: - chart: ../../../../k8s/helm/apigwmm + chart: ../../../../k8s/helm/apigwwm set: replicaCount: 1 image: @@ -15,7 +15,7 @@ install: kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]webmvc...aksapp.io - - $(spacePrefix)apigwmm$(hostSuffix) + - $(spacePrefix)apigwwm$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/values.dev.yaml b/src/ApiGateways/Web.Bff.Shopping/aggregator/values.dev.yaml new file mode 100644 index 000000000..45f664d6a --- /dev/null +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/values.dev.yaml @@ -0,0 +1,2 @@ +ocelot: + configPath: /app/configuration \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/values.dev.yaml b/src/Services/Basket/Basket.API/values.dev.yaml new file mode 100644 index 000000000..eaed45149 --- /dev/null +++ b/src/Services/Basket/Basket.API/values.dev.yaml @@ -0,0 +1,3 @@ +ingress: + enabled: true + tls: [] \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/values.dev.yaml b/src/Services/Catalog/Catalog.API/values.dev.yaml new file mode 100644 index 000000000..eaed45149 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/values.dev.yaml @@ -0,0 +1,3 @@ +ingress: + enabled: true + tls: [] \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/Devspaces/DevspacesRedirectUriValidator.cs b/src/Services/Identity/Identity.API/Devspaces/DevspacesRedirectUriValidator.cs new file mode 100644 index 000000000..53e497b59 --- /dev/null +++ b/src/Services/Identity/Identity.API/Devspaces/DevspacesRedirectUriValidator.cs @@ -0,0 +1,31 @@ +using IdentityServer4.Models; +using IdentityServer4.Validation; +using Microsoft.Extensions.Logging; +using System.Threading.Tasks; + + +namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces +{ + public class DevspacesRedirectUriValidator : IRedirectUriValidator + { + private readonly ILogger _logger; + public DevspacesRedirectUriValidator(ILogger logger) + { + _logger = logger; + } + + public Task IsPostLogoutRedirectUriValidAsync(string requestedUri, Client client) + { + + _logger.LogInformation($"Client {client.ClientName} used post logout uri {requestedUri}."); + return Task.FromResult(true); + } + + public Task IsRedirectUriValidAsync(string requestedUri, Client client) + { + _logger.LogInformation($"Client {client.ClientName} used redirect uri {requestedUri}."); + return Task.FromResult(true); + } + + } +} \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs b/src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs new file mode 100644 index 000000000..4dadb0e54 --- /dev/null +++ b/src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces +{ + static class IdentityDevspacesBuilderExtensions + { + public static IIdentityServerBuilder AddDevspacesIfNeeded(this IIdentityServerBuilder builder, bool useDevspaces) + { + if (useDevspaces) + { + builder.AddRedirectUriValidator(); + } + return builder; + } + } +} diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index aa390779e..9f83c6128 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -13,6 +13,7 @@ using Microsoft.eShopOnContainers.Services.Identity.API.Certificates; using Microsoft.eShopOnContainers.Services.Identity.API.Data; using Microsoft.eShopOnContainers.Services.Identity.API.Models; using Microsoft.eShopOnContainers.Services.Identity.API.Services; +using Microsoft.eShopOnContainers.Services.Identity.API.Devspaces; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -85,6 +86,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API x.IssuerUri = "null"; x.Authentication.CookieLifetime = TimeSpan.FromHours(2); }) + .AddDevspacesIfNeeded(Configuration.GetValue("UseDevspaces", false)) .AddSigningCredential(Certificate.Get()) .AddAspNetIdentity() .AddConfigurationStore(options => diff --git a/src/Services/Identity/Identity.API/values.dev.yaml b/src/Services/Identity/Identity.API/values.dev.yaml new file mode 100644 index 000000000..1d6ef67d3 --- /dev/null +++ b/src/Services/Identity/Identity.API/values.dev.yaml @@ -0,0 +1 @@ +enableDevspaces: "true" diff --git a/src/Services/Location/Locations.API/values.dev.yaml b/src/Services/Location/Locations.API/values.dev.yaml new file mode 100644 index 000000000..eaed45149 --- /dev/null +++ b/src/Services/Location/Locations.API/values.dev.yaml @@ -0,0 +1,3 @@ +ingress: + enabled: true + tls: [] \ No newline at end of file diff --git a/src/Services/Marketing/Marketing.API/values.dev.yaml b/src/Services/Marketing/Marketing.API/values.dev.yaml new file mode 100644 index 000000000..eaed45149 --- /dev/null +++ b/src/Services/Marketing/Marketing.API/values.dev.yaml @@ -0,0 +1,3 @@ +ingress: + enabled: true + tls: [] \ No newline at end of file diff --git a/src/Web/WebMVC/azds.yaml b/src/Web/WebMVC/azds.yaml index 5c95c50ee..69e4f036a 100644 --- a/src/Web/WebMVC/azds.yaml +++ b/src/Web/WebMVC/azds.yaml @@ -16,6 +16,9 @@ install: hosts: # This expands to [space.s.]webmvc...aksapp.io - $(spacePrefix)webmvc$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)webmvc$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? From 6d058d5ab0fd099254e58aea90fb6ac38058a921 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Tue, 19 Mar 2019 12:43:43 +0100 Subject: [PATCH 20/44] updated k8s.dns value --- src/Web/WebMVC/azds.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Web/WebMVC/azds.yaml b/src/Web/WebMVC/azds.yaml index 69e4f036a..99a24ecc0 100644 --- a/src/Web/WebMVC/azds.yaml +++ b/src/Web/WebMVC/azds.yaml @@ -18,7 +18,7 @@ install: - $(spacePrefix)webmvc$(hostSuffix) inf: k8s: - dns: $(spacePrefix)webmvc$(hostSuffix) + dns: $(spacePrefix)identity-api$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? From 1427fe8b7c8635c07afc963fb98bb4352bdcdea3 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Wed, 20 Mar 2019 16:39:09 +0100 Subject: [PATCH 21/44] trying mvc azds config --- src/Web/WebMVC/azds.yaml | 3 --- src/Web/WebMVC/values.dev.yaml | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/Web/WebMVC/values.dev.yaml diff --git a/src/Web/WebMVC/azds.yaml b/src/Web/WebMVC/azds.yaml index 99a24ecc0..5c95c50ee 100644 --- a/src/Web/WebMVC/azds.yaml +++ b/src/Web/WebMVC/azds.yaml @@ -16,9 +16,6 @@ install: hosts: # This expands to [space.s.]webmvc...aksapp.io - $(spacePrefix)webmvc$(hostSuffix) - inf: - k8s: - dns: $(spacePrefix)identity-api$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/Web/WebMVC/values.dev.yaml b/src/Web/WebMVC/values.dev.yaml new file mode 100644 index 000000000..19987b6f0 --- /dev/null +++ b/src/Web/WebMVC/values.dev.yaml @@ -0,0 +1,3 @@ +inf: + k8s: + dns: $(spacePrefix)identity-api$(hostSuffix) \ No newline at end of file From a327fac58619476cd09fd744c8cd8b7bbf3b247d Mon Sep 17 00:00:00 2001 From: eiximenis Date: Thu, 21 Mar 2019 10:17:35 +0100 Subject: [PATCH 22/44] updating middle name of azds config for catalog.api --- src/Services/Catalog/Catalog.API/azds.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Catalog/Catalog.API/azds.yaml b/src/Services/Catalog/Catalog.API/azds.yaml index cbceada43..2d24ce49d 100644 --- a/src/Services/Catalog/Catalog.API/azds.yaml +++ b/src/Services/Catalog/Catalog.API/azds.yaml @@ -14,7 +14,7 @@ install: kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]catalogapi...aksapp.io - - $(spacePrefix)basketapi$(hostSuffix) + - $(spacePrefix)catalogapi$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? From e809029e2cf4347142e36a95f9c13dd0f2e64997 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Thu, 28 Mar 2019 18:59:45 +0100 Subject: [PATCH 23/44] Final fixes to make it work under Devspaces --- .../templates/configmap.yaml | 3 +- .../templates/deployment.yaml | 4 +- .../Mobile.Bff.Marketing/apigw/azds.yaml | 5 +- .../Mobile.Bff.Shopping/aggregator/azds.yaml | 5 +- .../Mobile.Bff.Shopping/apigw/azds.yaml | 5 +- .../Web.Bff.Marketing/apigw/azds.yaml | 5 +- .../Web.Bff.Shopping/aggregator/azds.yaml | 5 +- .../Web.Bff.Shopping/apigw/azds.yaml | 6 +- src/Services/Basket/Basket.API/azds.yaml | 6 +- .../Controllers/CatalogController.cs | 9 +++ src/Services/Catalog/Catalog.API/azds.yaml | 6 +- src/Services/Identity/Identity.API/Startup.cs | 2 +- src/Services/Identity/Identity.API/azds.yaml | 6 +- src/Services/Location/Locations.API/azds.yaml | 6 +- .../Marketing/Marketing.API/azds.yaml | 6 +- src/Services/Ordering/Ordering.API/azds.yaml | 6 +- .../Dockerfile.develop | 18 ++++++ .../Ordering.BackgroundTasks/azds.yaml | 56 +++++++++++++++++++ .../Ordering.SignalrHub/Dockerfile.develop | 18 ++++++ .../Ordering/Ordering.SignalrHub/azds.yaml | 56 +++++++++++++++++++ src/Services/Payment/Payment.API/azds.yaml | 6 +- src/Services/Webhooks/Webhooks.API/azds.yaml | 6 +- src/Web/WebMVC/azds.yaml | 6 +- src/prepare-devspaces.ps1 | 6 ++ 24 files changed, 228 insertions(+), 29 deletions(-) create mode 100644 src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile.develop create mode 100644 src/Services/Ordering/Ordering.BackgroundTasks/azds.yaml create mode 100644 src/Services/Ordering/Ordering.SignalrHub/Dockerfile.develop create mode 100644 src/Services/Ordering/Ordering.SignalrHub/azds.yaml diff --git a/k8s/helm/ordering-backgroundtasks/templates/configmap.yaml b/k8s/helm/ordering-backgroundtasks/templates/configmap.yaml index 54fec785b..23041d4ac 100644 --- a/k8s/helm/ordering-backgroundtasks/templates/configmap.yaml +++ b/k8s/helm/ordering-backgroundtasks/templates/configmap.yaml @@ -1,10 +1,11 @@ {{- $name := include "ordering-backgroundtasks.fullname" . -}} {{- $sqlsrv := include "sql-name" . -}} +{{- $cfgname := printf "cfg-%s" $name | trunc 63 }} apiVersion: v1 kind: ConfigMap metadata: - name: "cfg-{{ $name }}" + name: "{{ $cfgname }}" labels: app: {{ template "ordering-backgroundtasks.name" . }} chart: {{ template "ordering-backgroundtasks.chart" .}} diff --git a/k8s/helm/ordering-backgroundtasks/templates/deployment.yaml b/k8s/helm/ordering-backgroundtasks/templates/deployment.yaml index 017f9f3dd..d93c7f764 100644 --- a/k8s/helm/ordering-backgroundtasks/templates/deployment.yaml +++ b/k8s/helm/ordering-backgroundtasks/templates/deployment.yaml @@ -1,11 +1,11 @@ {{- $name := include "ordering-backgroundtasks.fullname" . -}} -{{- $cfgname := printf "%s-%s" "cfg" $name -}} +{{- $cfgname := printf "cfg-%s" $name | trunc 63 }} + apiVersion: apps/v1beta2 kind: Deployment metadata: name: {{ template "ordering-backgroundtasks.fullname" . }} labels: - ufo: {{ $cfgname}} app: {{ template "ordering-backgroundtasks.name" . }} chart: {{ template "ordering-backgroundtasks.chart" . }} release: {{ .Release.Name }} diff --git a/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml b/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml index 1dc21a9f1..46375343b 100644 --- a/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml @@ -15,7 +15,10 @@ install: kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]webmvc...aksapp.io - - $(spacePrefix)apigwmm$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml index b4ffe0e20..8dbac7128 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml @@ -14,7 +14,10 @@ install: kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]apigwms...aksapp.io - - $(spacePrefix)mobileshoppingagg$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml index 01a2e36d1..9e2d09e42 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml @@ -15,7 +15,10 @@ install: kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]webmvc...aksapp.io - - $(spacePrefix)apigwms$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml b/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml index a0972d1f4..8f60cbcc7 100644 --- a/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml +++ b/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml @@ -15,7 +15,10 @@ install: kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]webmvc...aksapp.io - - $(spacePrefix)apigwwm$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml b/src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml index 63bb14c94..189d2261d 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml @@ -14,7 +14,10 @@ install: kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]apigwms...aksapp.io - - $(spacePrefix)webshoppingagg$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml b/src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml index 3aff7a62b..69f26cdca 100644 --- a/src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml +++ b/src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml @@ -14,8 +14,10 @@ install: annotations: kubernetes.io/ingress.class: traefik-azds hosts: - # This expands to [space.s.]webmvc...aksapp.io - - $(spacePrefix)apigwws$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/Services/Basket/Basket.API/azds.yaml b/src/Services/Basket/Basket.API/azds.yaml index 79baa83db..4fbbb7be4 100644 --- a/src/Services/Basket/Basket.API/azds.yaml +++ b/src/Services/Basket/Basket.API/azds.yaml @@ -14,8 +14,10 @@ install: annotations: kubernetes.io/ingress.class: traefik-azds hosts: - # This expands to [space.s.]basketapi...aksapp.io - - $(spacePrefix)basketapi$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs index d9fa4002e..5dfb10a96 100644 --- a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs +++ b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs @@ -60,6 +60,15 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers .Take(pageSize) .ToListAsync(); + /* The "awesome" fix for testing Devspaces */ + + /* + foreach (var pr in itemsOnPage) { + pr.Name = "Awesome " + pr.Name; + } + + */ + itemsOnPage = ChangeUriPlaceholder(itemsOnPage); var model = new PaginatedItemsViewModel(pageIndex, pageSize, totalItems, itemsOnPage); diff --git a/src/Services/Catalog/Catalog.API/azds.yaml b/src/Services/Catalog/Catalog.API/azds.yaml index 2d24ce49d..9f98a3793 100644 --- a/src/Services/Catalog/Catalog.API/azds.yaml +++ b/src/Services/Catalog/Catalog.API/azds.yaml @@ -13,8 +13,10 @@ install: annotations: kubernetes.io/ingress.class: traefik-azds hosts: - # This expands to [space.s.]catalogapi...aksapp.io - - $(spacePrefix)catalogapi$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 9f83c6128..2848dd6b2 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -86,7 +86,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API x.IssuerUri = "null"; x.Authentication.CookieLifetime = TimeSpan.FromHours(2); }) - .AddDevspacesIfNeeded(Configuration.GetValue("UseDevspaces", false)) + .AddDevspacesIfNeeded(Configuration.GetValue("EnableDevspaces", false)) .AddSigningCredential(Certificate.Get()) .AddAspNetIdentity() .AddConfigurationStore(options => diff --git a/src/Services/Identity/Identity.API/azds.yaml b/src/Services/Identity/Identity.API/azds.yaml index 117a3f6ae..0c47aab13 100644 --- a/src/Services/Identity/Identity.API/azds.yaml +++ b/src/Services/Identity/Identity.API/azds.yaml @@ -14,8 +14,10 @@ install: annotations: kubernetes.io/ingress.class: traefik-azds hosts: - # This expands to [space.s.]identity...aksapp.io - - $(spacePrefix)identity-api$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/Services/Location/Locations.API/azds.yaml b/src/Services/Location/Locations.API/azds.yaml index f528f62cd..e86a09927 100644 --- a/src/Services/Location/Locations.API/azds.yaml +++ b/src/Services/Location/Locations.API/azds.yaml @@ -14,8 +14,10 @@ install: annotations: kubernetes.io/ingress.class: traefik-azds hosts: - # This expands to [space.s.]identity...aksapp.io - - $(spacePrefix)locations-api$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/Services/Marketing/Marketing.API/azds.yaml b/src/Services/Marketing/Marketing.API/azds.yaml index b3f82709c..5d6418f83 100644 --- a/src/Services/Marketing/Marketing.API/azds.yaml +++ b/src/Services/Marketing/Marketing.API/azds.yaml @@ -14,8 +14,10 @@ install: annotations: kubernetes.io/ingress.class: traefik-azds hosts: - # This expands to [space.s.]identity...aksapp.io - - $(spacePrefix)marketing-api$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/Services/Ordering/Ordering.API/azds.yaml b/src/Services/Ordering/Ordering.API/azds.yaml index 39f2477b0..77398a0a8 100644 --- a/src/Services/Ordering/Ordering.API/azds.yaml +++ b/src/Services/Ordering/Ordering.API/azds.yaml @@ -14,8 +14,10 @@ install: annotations: kubernetes.io/ingress.class: traefik-azds hosts: - # This expands to [space.s.]orderingapi...aksapp.io - - $(spacePrefix)orderingapi$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile.develop b/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile.develop new file mode 100644 index 000000000..5f5d002db --- /dev/null +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile.develop @@ -0,0 +1,18 @@ +FROM microsoft/dotnet:2.2-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj", "src/Services/Ordering/Ordering.BackgroundTasks/"] + +RUN dotnet restore src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj +COPY . . +WORKDIR /src/src/Services/Ordering/Ordering.BackgroundTasks +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/azds.yaml b/src/Services/Ordering/Ordering.BackgroundTasks/azds.yaml new file mode 100644 index 000000000..e92eca09f --- /dev/null +++ b/src/Services/Ordering/Ordering.BackgroundTasks/azds.yaml @@ -0,0 +1,56 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/ordering-backgroundtasks + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: Dockerfile.develop + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${BUILD_CONFIGURATION:-Debug} + iterate: + processesToKill: + - dotnet + - vsdbg + buildCommands: + - - dotnet + - build + - --no-restore + - -c + - ${BUILD_CONFIGURATION:-Debug} diff --git a/src/Services/Ordering/Ordering.SignalrHub/Dockerfile.develop b/src/Services/Ordering/Ordering.SignalrHub/Dockerfile.develop new file mode 100644 index 000000000..d96223149 --- /dev/null +++ b/src/Services/Ordering/Ordering.SignalrHub/Dockerfile.develop @@ -0,0 +1,18 @@ +FROM microsoft/dotnet:2.2-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj", "src/Services/Ordering/Ordering.SignalrHub/"] + +RUN dotnet restore src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj +COPY . . +WORKDIR /src/src/Services/Ordering/Ordering.SignalrHub +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.SignalrHub/azds.yaml b/src/Services/Ordering/Ordering.SignalrHub/azds.yaml new file mode 100644 index 000000000..a98526394 --- /dev/null +++ b/src/Services/Ordering/Ordering.SignalrHub/azds.yaml @@ -0,0 +1,56 @@ +kind: helm-release +apiVersion: 1.1 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/ordering-signalrhub + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds + hosts: + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml +configurations: + develop: + build: + useGitIgnore: true + dockerfile: Dockerfile.develop + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' + command: + - dotnet + - run + - --no-restore + - --no-build + - --no-launch-profile + - -c + - ${BUILD_CONFIGURATION:-Debug} + iterate: + processesToKill: + - dotnet + - vsdbg + buildCommands: + - - dotnet + - build + - --no-restore + - -c + - ${BUILD_CONFIGURATION:-Debug} diff --git a/src/Services/Payment/Payment.API/azds.yaml b/src/Services/Payment/Payment.API/azds.yaml index a3e434ca2..2536d4371 100644 --- a/src/Services/Payment/Payment.API/azds.yaml +++ b/src/Services/Payment/Payment.API/azds.yaml @@ -14,8 +14,10 @@ install: annotations: kubernetes.io/ingress.class: traefik-azds hosts: - # This expands to [space.s.]paymentapi...aksapp.io - - $(spacePrefix)paymentapi$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/Services/Webhooks/Webhooks.API/azds.yaml b/src/Services/Webhooks/Webhooks.API/azds.yaml index f9d63ff21..38dfe92a2 100644 --- a/src/Services/Webhooks/Webhooks.API/azds.yaml +++ b/src/Services/Webhooks/Webhooks.API/azds.yaml @@ -13,8 +13,10 @@ install: annotations: kubernetes.io/ingress.class: traefik-azds hosts: - # This expands to [space.s.]webhooksapi...aksapp.io - - $(spacePrefix)webhooksapi$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/Web/WebMVC/azds.yaml b/src/Web/WebMVC/azds.yaml index 5c95c50ee..a9c3ed3ba 100644 --- a/src/Web/WebMVC/azds.yaml +++ b/src/Web/WebMVC/azds.yaml @@ -14,8 +14,10 @@ install: annotations: kubernetes.io/ingress.class: traefik-azds hosts: - # This expands to [space.s.]webmvc...aksapp.io - - $(spacePrefix)webmvc$(hostSuffix) + - $(spacePrefix)eshop$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)eshop$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/prepare-devspaces.ps1 b/src/prepare-devspaces.ps1 index 14b1cc6d1..5b692e908 100644 --- a/src/prepare-devspaces.ps1 +++ b/src/prepare-devspaces.ps1 @@ -49,6 +49,12 @@ Write-Host "Copying app.yaml and inf.yaml to Ordering API" -ForegroundColor Yell Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.API" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.API" -Force +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.SignalrHub" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.SignalrHub" -Force + +Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.BackgroundTasks" -Force +Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.BackgroundTasks" -Force + Write-Host "Copying app.yaml and inf.yaml to Payment API" -ForegroundColor Yellow Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Payment\Payment.API" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Payment\Payment.API" -Force From a962ac4c224cbaa899d0e61a6d975c91d984f354 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Fri, 29 Mar 2019 10:58:13 +0100 Subject: [PATCH 24/44] removing uneeded files --- docker-scripts/linux/install-node.sh | 8 -------- docker-scripts/win/install-node.cmd | 4 ---- 2 files changed, 12 deletions(-) delete mode 100644 docker-scripts/linux/install-node.sh delete mode 100644 docker-scripts/win/install-node.cmd diff --git a/docker-scripts/linux/install-node.sh b/docker-scripts/linux/install-node.sh deleted file mode 100644 index 73407aae9..000000000 --- a/docker-scripts/linux/install-node.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -export NODE_DOWNLOAD_SHA 0e20787e2eda4cc31336d8327556ebc7417e8ee0a6ba0de96a09b0ec2b841f60 -curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" --output nodejs.tar.gz \ - && echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \ - && tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \ - && rm nodejs.tar.gz \ - && ln -s /usr/local/bin/node /usr/local/bin/nodejs diff --git a/docker-scripts/win/install-node.cmd b/docker-scripts/win/install-node.cmd deleted file mode 100644 index eaa4e356c..000000000 --- a/docker-scripts/win/install-node.cmd +++ /dev/null @@ -1,4 +0,0 @@ -set NODE_VERSION=8.11.1 -curl -SL "https://nodejs.org/dist/v%NODE_VERSION%/node-v%NODE_VERSION%-win-x64.zip" --output nodejs.zip -tar -xf nodejs.zip -C c:\ -setx PATH "%PATH%;c:\node-v%NODE_VERSION%-win-x64" \ No newline at end of file From 7166773a7e3e962a22f97275a9b7c9c30bd567e8 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Fri, 29 Mar 2019 12:26:54 +0100 Subject: [PATCH 25/44] compose for put linux and win in tag --- docker-compose.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2a0448bad..8c523e122 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,7 @@ services: image: rabbitmq:3-management-alpine identity.api: - image: ${REGISTRY:-eshop}/identity.api:${TAG:-latest} + image: ${REGISTRY:-eshop}/identity.api:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Services/Identity/Identity.API/Dockerfile @@ -26,7 +26,7 @@ services: - sql.data basket.api: - image: ${REGISTRY:-eshop}/basket.api:${TAG:-latest} + image: ${REGISTRY:-eshop}/basket.api:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Services/Basket/Basket.API/Dockerfile @@ -36,7 +36,7 @@ services: - rabbitmq catalog.api: - image: ${REGISTRY:-eshop}/catalog.api:${TAG:-latest} + image: ${REGISTRY:-eshop}/catalog.api:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Services/Catalog/Catalog.API/Dockerfile @@ -45,7 +45,7 @@ services: - rabbitmq ordering.api: - image: ${REGISTRY:-eshop}/ordering.api:${TAG:-latest} + image: ${REGISTRY:-eshop}/ordering.api:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Services/Ordering/Ordering.API/Dockerfile @@ -54,7 +54,7 @@ services: - rabbitmq ordering.backgroundtasks: - image: ${REGISTRY:-eshop}/ordering.backgroundtasks:${TAG:-latest} + image: ${REGISTRY:-eshop}/ordering.backgroundtasks:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile @@ -63,7 +63,7 @@ services: - rabbitmq marketing.api: - image: ${REGISTRY:-eshop}/marketing.api:${TAG:-latest} + image: ${REGISTRY:-eshop}/marketing.api:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Services/Marketing/Marketing.API/Dockerfile @@ -74,7 +74,7 @@ services: - rabbitmq payment.api: - image: ${REGISTRY:-eshop}/payment.api:${TAG:-latest} + image: ${REGISTRY:-eshop}/payment.api:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Services/Payment/Payment.API/Dockerfile @@ -82,7 +82,7 @@ services: - rabbitmq locations.api: - image: ${REGISTRY:-eshop}/locations.api:${TAG:-latest} + image: ${REGISTRY:-eshop}/locations.api:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Services/Location/Locations.API/Dockerfile @@ -91,7 +91,7 @@ services: - rabbitmq webhooks.api: - image: ${REGISTRY:-eshop}/webhooks.api:${TAG:-latest} + image: ${REGISTRY:-eshop}/webhooks.api:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Services/Webhooks/Webhooks.API/Dockerfile @@ -99,7 +99,7 @@ services: - sql.data mobileshoppingapigw: - image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest} + image: ${REGISTRY:-eshop}/ocelotapigw:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile @@ -114,7 +114,7 @@ services: - basket.api mobilemarketingapigw: - image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest} + image: ${REGISTRY:-eshop}/ocelotapigw:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile @@ -129,7 +129,7 @@ services: - basket.api webshoppingapigw: - image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest} + image: ${REGISTRY:-eshop}/ocelotapigw:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile @@ -144,7 +144,7 @@ services: - basket.api webmarketingapigw: - image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest} + image: ${REGISTRY:-eshop}/ocelotapigw:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile @@ -159,7 +159,7 @@ services: - basket.api mobileshoppingagg: - image: ${REGISTRY:-eshop}/mobileshoppingagg:${TAG:-latest} + image: ${REGISTRY:-eshop}/mobileshoppingagg:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile @@ -174,7 +174,7 @@ services: - basket.api webshoppingagg: - image: ${REGISTRY:-eshop}/webshoppingagg:${TAG:-latest} + image: ${REGISTRY:-eshop}/webshoppingagg:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile @@ -189,7 +189,7 @@ services: - basket.api ordering.signalrhub: - image: ${REGISTRY:-eshop}/ordering.signalrhub:${TAG:-latest} + image: ${REGISTRY:-eshop}/ordering.signalrhub:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Services/Ordering/Ordering.SignalrHub/Dockerfile @@ -204,13 +204,13 @@ services: - basket.api webstatus: - image: ${REGISTRY:-eshop}/webstatus:${TAG:-latest} + image: ${REGISTRY:-eshop}/webstatus:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Web/WebStatus/Dockerfile webspa: - image: ${REGISTRY:-eshop}/webspa:${TAG:-latest} + image: ${REGISTRY:-eshop}/webspa:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Web/WebSPA/Dockerfile @@ -220,7 +220,7 @@ services: # - webmarketingapigw webmvc: - image: ${REGISTRY:-eshop}/webmvc:${TAG:-latest} + image: ${REGISTRY:-eshop}/webmvc:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Web/WebMVC/Dockerfile @@ -230,7 +230,7 @@ services: - webmarketingapigw webhooks.client: - image: ${REGISTRY:-eshop}/webhooks.client:${TAG:-latest} + image: ${REGISTRY:-eshop}/webhooks.client:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: src/Web/WebhookClient/Dockerfile From 8ef234a9608c0d93f51e468af52a6aa2a9f34139 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Fri, 29 Mar 2019 13:54:20 +0100 Subject: [PATCH 26/44] PS1 for creating multiarch manifests --- .../multiarch-manifests/create-manifests.ps1 | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 build/multiarch-manifests/create-manifests.ps1 diff --git a/build/multiarch-manifests/create-manifests.ps1 b/build/multiarch-manifests/create-manifests.ps1 new file mode 100644 index 000000000..cc7f05194 --- /dev/null +++ b/build/multiarch-manifests/create-manifests.ps1 @@ -0,0 +1,26 @@ +Param( + [parameter(Mandatory=$true)][string]$registry +) + +if ([String]::IsNullOrEmpty($registry)) { + Write-Host "Registry must be set to docker registry to use" -ForegroundColor Red + exit 1 +} + +Write-Host "This script creates the local manifests, for pushing the multi-arch manifests" -ForegroundColor Yellow +Write-Host "Tags used are linux-master, win-master, linux-dev, win-dev, linux-latest, win-latest" -ForegroundColor Yellow +Write-Host "Multiarch images tags will be master, dev, latest" -ForegroundColor Yellow + + +$services = "identity.api", "basket.api", "catalog.api", "ordering.api", "ordering.backgroundtasks", "marketing.api", "payment.api", "locations.api", "webhooks.api", "ocelotapigw", "mobileshoppingagg", "webshoppingagg", "ordering.signalrhub", "webstatus", "webspa", "webmvc", "webhooks.client" + +foreach ($svc in $services) { + Write-Host "Creating manifest for $svc and tags :latest, :master, and :dev" + docker manifest create $registry/${svc}:master $registry/${svc}:linux-master $registry/${svc}:win-master + docker manifest create $registry/${svc}:dev $registry/${svc}:linux-dev $registry/${svc}:win-dev + docker manifest create $registry/${svc}:latest $registry/${svc}:linux-latest $registry/${svc}:win-latest + Write-Host "Pushing manifest for $svc and tags :latest, :master, and :dev" + docker manifest push $registry/${svc}:latest + docker manifest push $registry/${svc}:dev + docker manifest push $registry/${svc}:master +} \ No newline at end of file From dea042b3da2de661f00ec3abc71408e22d35da65 Mon Sep 17 00:00:00 2001 From: Ratan Sunder Parai Date: Mon, 1 Apr 2019 22:13:45 +0600 Subject: [PATCH 27/44] fix markdown headers --- src/Services/Identity/Identity.API/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/Identity/Identity.API/README.md b/src/Services/Identity/Identity.API/README.md index 76e599dea..ffaaed531 100644 --- a/src/Services/Identity/Identity.API/README.md +++ b/src/Services/Identity/Identity.API/README.md @@ -2,10 +2,10 @@ Sample reference containerized application, cross-platform and microservices architecture. Powered by Microsoft -#Overview +## Overview This sample runs a microservices oriented application and a .net core Mvc application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution. -#Setup +## Setup This service is a identity provider or STS (Security Token Service) currently implemented with IdentityServer 4 wrapping ASP.NET Identity underneath. Check procedures on how to get the sample app started at the Wiki: From a10d9fb663606336962d0e48871ebd194f9394d8 Mon Sep 17 00:00:00 2001 From: rafsanulhasan Date: Tue, 2 Apr 2019 15:57:04 +0600 Subject: [PATCH 28/44] fix typo --- src/Services/Catalog/Catalog.API/Model/CatalogItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Catalog/Catalog.API/Model/CatalogItem.cs b/src/Services/Catalog/Catalog.API/Model/CatalogItem.cs index 459c60098..2e4579f7f 100644 --- a/src/Services/Catalog/Catalog.API/Model/CatalogItem.cs +++ b/src/Services/Catalog/Catalog.API/Model/CatalogItem.cs @@ -64,7 +64,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Model if (quantityDesired <= 0) { - throw new CatalogDomainException($"Item units desired should be greater than cero"); + throw new CatalogDomainException($"Item units desired should be greater than zero"); } int removed = Math.Min(quantityDesired, this.AvailableStock); From 12017dd8b752c845fed2d9673b5cee62c23e6b08 Mon Sep 17 00:00:00 2001 From: rafsanulhasan Date: Tue, 2 Apr 2019 15:58:58 +0600 Subject: [PATCH 29/44] Add launch settings on each project to ignore change when the project is opened --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 69800e3b7..1049a8400 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs +# Project Launch Settings +Properties/launchSettings.json + # Build results [Dd]ebug/ [Dd]ebugPublic/ From 641982a5ab5ad2d8c228d7865ec6af6a15257413 Mon Sep 17 00:00:00 2001 From: rafsanulhasan Date: Tue, 2 Apr 2019 17:54:43 +0600 Subject: [PATCH 30/44] correct typo --- .../Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs index 99b3154d8..7da025d3a 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs @@ -132,7 +132,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O AddDomainEvent(new OrderStatusChangedToPaidDomainEvent(Id, OrderItems)); _orderStatusId = OrderStatus.Paid.Id; - _description = "The payment was performed at a simulated \"American Bank checking bank account endinf on XX35071\""; + _description = "The payment was performed at a simulated \"American Bank checking bank account ending on XX35071\""; } } From c48962202965a72c5f2372410914adf96d2ff0dc Mon Sep 17 00:00:00 2001 From: rafsanulhasan Date: Tue, 2 Apr 2019 18:47:47 +0600 Subject: [PATCH 31/44] Removed Microsoft.Web.LibraryManager.Build NuGet package --- src/Services/Identity/Identity.API/Identity.API.csproj | 1 - src/Web/WebMVC/WebMVC.csproj | 3 +-- src/Web/WebStatus/WebStatus.csproj | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index 728843f71..ea4bcc0ce 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -28,7 +28,6 @@ - diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index 6f466d730..910577d8e 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -31,10 +31,9 @@ - + - diff --git a/src/Web/WebStatus/WebStatus.csproj b/src/Web/WebStatus/WebStatus.csproj index e66f0a211..2b5a29b68 100644 --- a/src/Web/WebStatus/WebStatus.csproj +++ b/src/Web/WebStatus/WebStatus.csproj @@ -22,7 +22,6 @@ - From 8dc243accc2ec008692fa2fd9cdce6497b030629 Mon Sep 17 00:00:00 2001 From: rafsanulhasan Date: Tue, 2 Apr 2019 19:09:13 +0600 Subject: [PATCH 32/44] changed Razor Syntaxes to Tag Helpers --- .../Identity/Identity.API/Views/Consent/Index.cshtml | 6 +++--- src/Web/WebMVC/Views/Campaigns/Details.cshtml | 7 ++++--- src/Web/WebMVC/Views/Campaigns/Index.cshtml | 11 ++++++----- src/Web/WebMVC/Views/Cart/Index.cshtml | 7 ++++--- src/Web/WebMVC/Views/Catalog/Index.cshtml | 6 +++--- src/Web/WebMVC/Views/Order/Create.cshtml | 7 ++++--- src/Web/WebMVC/Views/Order/Detail.cshtml | 7 ++++--- src/Web/WebMVC/Views/Order/Index.cshtml | 11 ++++++----- src/Web/WebMVC/Views/OrderManagement/Index.cshtml | 7 ++++--- 9 files changed, 38 insertions(+), 31 deletions(-) diff --git a/src/Services/Identity/Identity.API/Views/Consent/Index.cshtml b/src/Services/Identity/Identity.API/Views/Consent/Index.cshtml index 03f026bda..08c316553 100644 --- a/src/Services/Identity/Identity.API/Views/Consent/Index.cshtml +++ b/src/Services/Identity/Identity.API/Views/Consent/Index.cshtml @@ -16,7 +16,7 @@
- @Html.Partial("_ValidationSummary") +
@@ -49,7 +49,7 @@
    @foreach (var scope in Model.ResourceScopes) { - @Html.Partial("_ScopeListItem", scope) + }
diff --git a/src/Web/WebMVC/Views/Campaigns/Details.cshtml b/src/Web/WebMVC/Views/Campaigns/Details.cshtml index df3b600e1..979a6bce6 100644 --- a/src/Web/WebMVC/Views/Campaigns/Details.cshtml +++ b/src/Web/WebMVC/Views/Campaigns/Details.cshtml @@ -1,6 +1,9 @@ @{ ViewData["Title"] = "Campaign details"; @model CampaignItem + var headerList= new List
() { + new Header() { Controller = "Catalog", Text = "Back to catalog" }, + new Header() { Controller = "Campaigns", Text = "Back to Campaigns" } }; }
@@ -8,9 +11,7 @@
-@Html.Partial("_Header", new List
() { - new Header() { Controller = "Catalog", Text = "Back to catalog" }, - new Header() { Controller = "Campaigns", Text = "Back to Campaigns" } }) +
diff --git a/src/Web/WebMVC/Views/Campaigns/Index.cshtml b/src/Web/WebMVC/Views/Campaigns/Index.cshtml index 7bfe7edd5..84f893291 100644 --- a/src/Web/WebMVC/Views/Campaigns/Index.cshtml +++ b/src/Web/WebMVC/Views/Campaigns/Index.cshtml @@ -1,6 +1,8 @@ @{ ViewData["Title"] = "Campaigns"; -@model WebMVC.ViewModels.CampaignViewModel + @model WebMVC.ViewModels.CampaignViewModel + var headerList= new List
() { + new Header() { Controller = "Catalog", Text = "Back to catalog" } }; }
@@ -9,8 +11,7 @@
-@Html.Partial("_Header", new List
() { - new Header() { Controller = "Catalog", Text = "Back to catalog" } }) +

@@ -58,12 +59,12 @@ @foreach (var catalogItem in Model.CampaignItems) {
- @Html.Partial("_campaign", catalogItem) +
}
- @Html.Partial("_pagination", Model.PaginationInfo) + } else { diff --git a/src/Web/WebMVC/Views/Cart/Index.cshtml b/src/Web/WebMVC/Views/Cart/Index.cshtml index d9386a1fd..398a66181 100644 --- a/src/Web/WebMVC/Views/Cart/Index.cshtml +++ b/src/Web/WebMVC/Views/Cart/Index.cshtml @@ -5,13 +5,14 @@ @inject IIdentityParser UserManager @{ - ViewData["Title"] = "My Cart"; + ViewData["Title"] = "My Cart"; + var headerList = new List
() { + new Header() { Controller = "Catalog", Text = "Back to catalog" }}; }
- @Html.Partial("_Header", new List
() { - new Header() { Controller = "Catalog", Text = "Back to catalog" } }) + @await Component.InvokeAsync("CartList", new { user = UserManager.Parse(User) })
diff --git a/src/Web/WebMVC/Views/Catalog/Index.cshtml b/src/Web/WebMVC/Views/Catalog/Index.cshtml index c2ef7f367..e8f26d345 100644 --- a/src/Web/WebMVC/Views/Catalog/Index.cshtml +++ b/src/Web/WebMVC/Views/Catalog/Index.cshtml @@ -35,18 +35,18 @@ @if (Model.CatalogItems.Count() > 0) { - @Html.Partial("_pagination", Model.PaginationInfo) +
@foreach (var catalogItem in Model.CatalogItems) {
- @Html.Partial("_product", catalogItem) +
}
- @Html.Partial("_pagination", Model.PaginationInfo) + } else { diff --git a/src/Web/WebMVC/Views/Order/Create.cshtml b/src/Web/WebMVC/Views/Order/Create.cshtml index d9b06c67f..96eb56c72 100644 --- a/src/Web/WebMVC/Views/Order/Create.cshtml +++ b/src/Web/WebMVC/Views/Order/Create.cshtml @@ -3,11 +3,12 @@ @inject IIdentityParser UserManager @{ - ViewData["Title"] = "New Order"; + ViewData["Title"] = "New Order"; + var headerList= new List
() { + new Header() { Controller = "Cart", Text = "Back to cart" } }; } -@Html.Partial("_Header", new List
() { - new Header() { Controller = "Cart", Text = "Back to cart" } }) +
diff --git a/src/Web/WebMVC/Views/Order/Detail.cshtml b/src/Web/WebMVC/Views/Order/Detail.cshtml index 5b7dadf25..6b7c0b46e 100644 --- a/src/Web/WebMVC/Views/Order/Detail.cshtml +++ b/src/Web/WebMVC/Views/Order/Detail.cshtml @@ -3,12 +3,13 @@ @model Microsoft.eShopOnContainers.WebMVC.ViewModels.Order @{ - ViewData["Title"] = "Order Detail"; + ViewData["Title"] = "Order Detail"; + var headerList= new List
() { + new Header() { Controller = "Catalog", Text = "Back to catalog" } }; }
- @Html.Partial("_Header", new List
() { - new Header() { Controller = "Catalog", Text = "Back to catalog" } }) +
diff --git a/src/Web/WebMVC/Views/Order/Index.cshtml b/src/Web/WebMVC/Views/Order/Index.cshtml index 43cb389c1..d3247433c 100644 --- a/src/Web/WebMVC/Views/Order/Index.cshtml +++ b/src/Web/WebMVC/Views/Order/Index.cshtml @@ -3,14 +3,15 @@ @model IEnumerable @{ - ViewData["Title"] = "My Orders"; + ViewData["Title"] = "My Orders"; + var headerList= new List
() { + new Header() { Controller = "Catalog", Text = "Back to catalog" }, + new Header() { Text = " / " }, + new Header() { Controller = "OrderManagement", Text = "Orders Management" } }; }
- @Html.Partial("_Header", new List
() { -new Header() { Controller = "Catalog", Text = "Back to catalog" }, -new Header() { Text = " / " }, -new Header() { Controller = "OrderManagement", Text = "Orders Management" } }) +
diff --git a/src/Web/WebMVC/Views/OrderManagement/Index.cshtml b/src/Web/WebMVC/Views/OrderManagement/Index.cshtml index acceace31..6f7130bf4 100644 --- a/src/Web/WebMVC/Views/OrderManagement/Index.cshtml +++ b/src/Web/WebMVC/Views/OrderManagement/Index.cshtml @@ -3,12 +3,13 @@ @model IEnumerable @{ - ViewData["Title"] = "My Orders"; + ViewData["Title"] = "My Orders"; + var headerList = new List
() { + new Header() { Controller = "Catalog", Text = "Back to catalog" } }; }
- @Html.Partial("_Header", new List
() { - new Header() { Controller = "Catalog", Text = "Back to catalog" } }) +
From 396d33fe7b95de424b7cb88c344851d44db3f746 Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Tue, 2 Apr 2019 15:36:20 +0100 Subject: [PATCH 33/44] Use AsyncEventingBasicConsumer in RabbitMQ to properly use async event handlers --- .../EventBusRabbitMQ/EventBusRabbitMQ.cs | 47 +++++++++++++------ src/Services/Basket/Basket.API/Startup.cs | 3 +- src/Services/Catalog/Catalog.API/Startup.cs | 3 +- .../Location/Locations.API/Startup.cs | 3 +- .../Marketing/Marketing.API/Startup.cs | 3 +- src/Services/Ordering/Ordering.API/Startup.cs | 3 +- .../Ordering.BackgroundTasks/Startup.cs | 3 +- .../Ordering/Ordering.SignalrHub/Startup.cs | 3 +- src/Services/Payment/Payment.API/Startup.cs | 3 +- src/Services/Webhooks/Webhooks.API/Startup.cs | 3 +- 10 files changed, 51 insertions(+), 23 deletions(-) diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs index 9044a4283..397b75017 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs @@ -178,27 +178,46 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ { if (_consumerChannel != null) { - var consumer = new EventingBasicConsumer(_consumerChannel); - consumer.Received += async (model, ea) => - { - var eventName = ea.RoutingKey; - var message = Encoding.UTF8.GetString(ea.Body); - - await ProcessEvent(eventName, message); + var consumer = new AsyncEventingBasicConsumer(_consumerChannel); - _consumerChannel.BasicAck(ea.DeliveryTag, multiple: false); - }; + consumer.Received += Consumer_Received; - _consumerChannel.BasicConsume(queue: _queueName, - autoAck: false, - consumer: consumer); + _consumerChannel.BasicConsume( + queue: _queueName, + autoAck: false, + consumer: consumer); } else { - _logger.LogError("StartBasicConsume can not call on _consumerChannelCreated == false"); + _logger.LogError("StartBasicConsume can't call on _consumerChannel == null"); } } + private async Task Consumer_Received(object sender, BasicDeliverEventArgs eventArgs) + { + var eventName = eventArgs.RoutingKey; + var message = Encoding.UTF8.GetString(eventArgs.Body); + + try + { + if (message.ToLowerInvariant().Contains("throw-fake-exception")) + { + throw new InvalidOperationException($"Fake exception requested: \"{message}\""); + } + + await ProcessEvent(eventName, message); + } + catch (Exception ex) + { + _logger.LogWarning(ex, "----- ERROR Processing message \"{Message}\"", message); + } + + // Even on exception we take the message off the queue. + // in a REAL WORLD app this should be handled with a Dead Letter Exchange (DLX). + // For more information see: https://www.rabbitmq.com/dlx.html + _consumerChannel.BasicAck(eventArgs.DeliveryTag, multiple: false); + } + private IModel CreateConsumerChannel() { if (!_persistentConnection.IsConnected) @@ -209,7 +228,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ var channel = _persistentConnection.CreateModel(); channel.ExchangeDeclare(exchange: BROKER_NAME, - type: "direct"); + type: "direct"); channel.QueueDeclare(queue: _queueName, durable: true, diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index 235b787d0..97ede1879 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -105,7 +105,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API var factory = new ConnectionFactory() { - HostName = Configuration["EventBusConnection"] + HostName = Configuration["EventBusConnection"], + DispatchConsumersAsync = true }; if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 0258a0a98..1a51a86fb 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -297,7 +297,8 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API var factory = new ConnectionFactory() { - HostName = configuration["EventBusConnection"] + HostName = configuration["EventBusConnection"], + DispatchConsumersAsync = true }; if (!string.IsNullOrEmpty(configuration["EventBusUserName"])) diff --git a/src/Services/Location/Locations.API/Startup.cs b/src/Services/Location/Locations.API/Startup.cs index 6d5fe3200..4664381d0 100644 --- a/src/Services/Location/Locations.API/Startup.cs +++ b/src/Services/Location/Locations.API/Startup.cs @@ -77,7 +77,8 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API var factory = new ConnectionFactory() { - HostName = Configuration["EventBusConnection"] + HostName = Configuration["EventBusConnection"], + DispatchConsumersAsync = true }; if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) diff --git a/src/Services/Marketing/Marketing.API/Startup.cs b/src/Services/Marketing/Marketing.API/Startup.cs index 75c749452..7f990e3ad 100644 --- a/src/Services/Marketing/Marketing.API/Startup.cs +++ b/src/Services/Marketing/Marketing.API/Startup.cs @@ -101,7 +101,8 @@ var factory = new ConnectionFactory() { - HostName = Configuration["EventBusConnection"] + HostName = Configuration["EventBusConnection"], + DispatchConsumersAsync = true }; if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index cd34f98dd..b77354052 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -305,7 +305,8 @@ var factory = new ConnectionFactory() { - HostName = configuration["EventBusConnection"] + HostName = configuration["EventBusConnection"], + DispatchConsumersAsync = true }; if (!string.IsNullOrEmpty(configuration["EventBusUserName"])) diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs index 683fe1d0c..9d6a78e38 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs @@ -68,7 +68,8 @@ namespace Ordering.BackgroundTasks var factory = new ConnectionFactory() { - HostName = Configuration["EventBusConnection"] + HostName = Configuration["EventBusConnection"], + DispatchConsumersAsync = true }; if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) diff --git a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs index e8bb7ecd1..edcc80521 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs @@ -80,7 +80,8 @@ namespace Ordering.SignalrHub var factory = new ConnectionFactory() { - HostName = Configuration["EventBusConnection"] + HostName = Configuration["EventBusConnection"], + DispatchConsumersAsync = true }; if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) diff --git a/src/Services/Payment/Payment.API/Startup.cs b/src/Services/Payment/Payment.API/Startup.cs index 4d5010868..39bb78f91 100644 --- a/src/Services/Payment/Payment.API/Startup.cs +++ b/src/Services/Payment/Payment.API/Startup.cs @@ -58,7 +58,8 @@ namespace Payment.API var logger = sp.GetRequiredService>(); var factory = new ConnectionFactory() { - HostName = Configuration["EventBusConnection"] + HostName = Configuration["EventBusConnection"], + DispatchConsumersAsync = true }; if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index 654b1c897..9d39da719 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -320,7 +320,8 @@ namespace Webhooks.API var factory = new ConnectionFactory() { - HostName = configuration["EventBusConnection"] + HostName = configuration["EventBusConnection"], + DispatchConsumersAsync = true }; if (!string.IsNullOrEmpty(configuration["EventBusUserName"])) From 6277c0481acfa19099ad4ced6707b25d31a81ea9 Mon Sep 17 00:00:00 2001 From: Nish Anil Date: Tue, 2 Apr 2019 20:21:49 +0530 Subject: [PATCH 34/44] Added tables for Build Status --- README.md | 71 ++++++++++++------------------------------------------- 1 file changed, 15 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 6fceb20ee..d4f9d2621 100644 --- a/README.md +++ b/README.md @@ -5,66 +5,25 @@ Sample .NET Core reference application, powered by Microsoft, based on a simplif Dev branch contains the latest "stable" code, and their images are tagged with `:dev` in our [Docker Hub](https://cloud.docker.com/u/eshop/repository/list): -Api Gateways base image +| Basket API | Catalog API | Identity API | Location API | +| ------------- | ------------- | ------------- | ------------- | +| [![Basket API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/basket?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=199&branchName=dev) | [![Catalog API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/catalog?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=197&branchName=dev) | [![Identity API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/identity?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=200&branchName=dev) | [![Location API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/location?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=202&branchName=dev) | -[![Api Gateways base image](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/apigws?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=201&branchName=dev) +| Marketing API | Ordering API | Payment API | Api Gateways base image | +| ------------- | ------------- | ------------- | ------------- | +| [![Marketing API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/marketing?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=203&branchName=dev) | [![Ordering API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/ordering?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=198&branchName=dev) | [![Payment API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/payment?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=205&branchName=dev) | [![Api Gateways base image](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/apigws?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=201&branchName=dev) -Basket API +| Web Shopping Aggregator | Mobile Shopping Aggregator | +| ------------- | ------------- | +| [![Web Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/web-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=206&branchName=dev) | [![Mobile Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/mobile-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=204&branchName=dev) | -[![Basket API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/basket?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=199&branchName=dev) - -Catalog API - -[![Catalog API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/catalog?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=197&branchName=dev) - -Identity API - -[![Identity API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/identity?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=200&branchName=dev) - -Location API - -[![Location API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/location?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=202&branchName=dev) - -Marketing API - -[![Marketing API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/marketing?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=203&branchName=dev) - -Ordering API - -[![Ordering API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/ordering?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=198&branchName=dev) - -Payment API - -[![Payment API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/payment?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=205&branchName=dev) - -Webhooks API - -[![Webhooks API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=207&branchName=dev) - -Web Shopping Aggregator - -[![Web Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/web-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=206&branchName=dev) - -Mobile Shopping Aggregator - -[![Mobile Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/mobile-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=204&branchName=dev) - -Webbhooks demo client - -[![Webhooks demo client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks-client?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=208&branchName=dev) - -WebMVC Client - -[![WebMVC Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webmvc?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=209&branchName=dev) - -WebSPA Client - -[![WebSPA Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webspa?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=210&branchName=dev) - -Web Status - -[![Web Status](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webstatus?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=211&branchName=dev) +| WebMVC Client | WebSPA Client | Web Status | +| ------------- | ------------- | ------------- | +| [![WebMVC Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webmvc?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=209&branchName=dev) | [![WebSPA Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webspa?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=210&branchName=dev) | [![Web Status](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webstatus?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=211&branchName=dev) +| Webhooks API | Webbhooks demo client | +| ------------- | ------------- | +| [![Webhooks API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=207&branchName=dev) | [![Webhooks demo client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks-client?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=208&branchName=dev) | ## IMPORTANT NOTES! **You can use either the latest version of Visual Studio or simply Docker CLI and .NET CLI for Windows, Mac and Linux**. From 3f7307ace72c9f395f71af9ed32e793b552caca9 Mon Sep 17 00:00:00 2001 From: Nish Anil Date: Tue, 2 Apr 2019 20:28:03 +0530 Subject: [PATCH 35/44] Updated Table alignment --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d4f9d2621..2a8f8e22c 100644 --- a/README.md +++ b/README.md @@ -13,17 +13,13 @@ Dev branch contains the latest "stable" code, and their images are tagged with ` | ------------- | ------------- | ------------- | ------------- | | [![Marketing API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/marketing?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=203&branchName=dev) | [![Ordering API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/ordering?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=198&branchName=dev) | [![Payment API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/payment?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=205&branchName=dev) | [![Api Gateways base image](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/apigws?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=201&branchName=dev) -| Web Shopping Aggregator | Mobile Shopping Aggregator | -| ------------- | ------------- | -| [![Web Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/web-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=206&branchName=dev) | [![Mobile Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/mobile-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=204&branchName=dev) | +| Web Shopping Aggregator | Mobile Shopping Aggregator | WebMVC Client | WebSPA Client | +| ------------- | ------------- | ------------- | ------------- | +| [![Web Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/web-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=206&branchName=dev) | [![Mobile Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/mobile-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=204&branchName=dev) | [![WebMVC Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webmvc?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=209&branchName=dev) | [![WebSPA Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webspa?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=210&branchName=dev) | -| WebMVC Client | WebSPA Client | Web Status | +| Web Status | Webhooks API | Webbhooks demo client | | ------------- | ------------- | ------------- | -| [![WebMVC Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webmvc?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=209&branchName=dev) | [![WebSPA Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webspa?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=210&branchName=dev) | [![Web Status](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webstatus?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=211&branchName=dev) - -| Webhooks API | Webbhooks demo client | -| ------------- | ------------- | -| [![Webhooks API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=207&branchName=dev) | [![Webhooks demo client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks-client?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=208&branchName=dev) | + [![Web Status](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webstatus?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=211&branchName=dev) | [![Webhooks API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=207&branchName=dev) | [![Webhooks demo client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks-client?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=208&branchName=dev) | ## IMPORTANT NOTES! **You can use either the latest version of Visual Studio or simply Docker CLI and .NET CLI for Windows, Mac and Linux**. From 835c3a8639178b53db73c49eda2530f5409e34e2 Mon Sep 17 00:00:00 2001 From: Rafsanul Hasan Date: Tue, 2 Apr 2019 21:15:11 +0600 Subject: [PATCH 36/44] Update .gitignore revert back to original one --- .gitignore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 1049a8400..8bad337c5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,9 +11,6 @@ # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs -# Project Launch Settings -Properties/launchSettings.json - # Build results [Dd]ebug/ [Dd]ebugPublic/ @@ -272,4 +269,4 @@ pub/ .mfractor # Ignore HealthCheckdb -*healthchecksdb* \ No newline at end of file +*healthchecksdb* From a793608b39b23d1108784e857ffc1203466c98b7 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Wed, 3 Apr 2019 17:45:01 +0200 Subject: [PATCH 37/44] update build to multijob --- build/azure-devops/apigws/azure-pipelines.yml | 96 ++++++++++++------- 1 file changed, 63 insertions(+), 33 deletions(-) diff --git a/build/azure-devops/apigws/azure-pipelines.yml b/build/azure-devops/apigws/azure-pipelines.yml index d2f4708f6..adf00e4d0 100644 --- a/build/azure-devops/apigws/azure-pipelines.yml +++ b/build/azure-devops/apigws/azure-pipelines.yml @@ -1,5 +1,3 @@ -pool: - vmImage: 'ubuntu-16.04' variables: registryEndpoint: eshop-registry trigger: @@ -17,34 +15,66 @@ trigger: exclude: - src/ApiGateways/Mobile.Bff.Shopping/aggregator/* - src/ApiGateways/Web.Bff.Shopping/aggregator/* -steps: -- task: DockerCompose@0 - displayName: Compose build apigws - inputs: - dockerComposeCommand: 'build mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw' - containerregistrytype: Container Registry - dockerRegistryEndpoint: $(registryEndpoint) - dockerComposeFile: docker-compose.yml - qualifyImageNames: true - projectName: "" - dockerComposeFileArgs: | - TAG=$(Build.SourceBranchName) -- task: DockerCompose@0 - displayName: Compose push apigws - inputs: - dockerComposeCommand: 'push mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw' - containerregistrytype: Container Registry - dockerRegistryEndpoint: $(registryEndpoint) - dockerComposeFile: docker-compose.yml - qualifyImageNames: true - projectName: "" - dockerComposeFileArgs: | - TAG=$(Build.SourceBranchName) -- task: CopyFiles@2 - inputs: - sourceFolder: $(Build.SourcesDirectory)/k8s/helm - targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm -- task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm - artifactName: helm +jobs: +- job: BuildLinux + pool: + vmImage: 'ubuntu-16.04' + steps: + - task: DockerCompose@0 + displayName: Compose build apigws + inputs: + dockerComposeCommand: 'build mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw' + containerregistrytype: Container Registry + dockerRegistryEndpoint: $(registryEndpoint) + dockerComposeFile: docker-compose.yml + qualifyImageNames: true + projectName: "" + dockerComposeFileArgs: | + TAG=$(Build.SourceBranchName) + - task: DockerCompose@0 + displayName: Compose push apigws + inputs: + dockerComposeCommand: 'push mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw' + containerregistrytype: Container Registry + dockerRegistryEndpoint: $(registryEndpoint) + dockerComposeFile: docker-compose.yml + qualifyImageNames: true + projectName: "" + dockerComposeFileArgs: | + TAG=$(Build.SourceBranchName) + - task: CopyFiles@2 + inputs: + sourceFolder: $(Build.SourcesDirectory)/k8s/helm + targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm + artifactName: helm +- job: BuildWindows + pool: + vmImage: 'vs2017-win2016' + steps: + - task: DockerCompose@0 + displayName: Compose build apigws + inputs: + dockerComposeCommand: 'build mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw' + containerregistrytype: Container Registry + dockerRegistryEndpoint: $(registryEndpoint) + dockerComposeFile: docker-compose.yml + qualifyImageNames: true + projectName: "" + dockerComposeFileArgs: | + TAG=$(Build.SourceBranchName) + PLATFORM=win + - task: DockerCompose@0 + displayName: Compose push apigws + inputs: + dockerComposeCommand: 'push mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw' + containerregistrytype: Container Registry + dockerRegistryEndpoint: $(registryEndpoint) + dockerComposeFile: docker-compose.yml + qualifyImageNames: true + projectName: "" + dockerComposeFileArgs: | + TAG=$(Build.SourceBranchName) + PLATFORM=win \ No newline at end of file From e536cbd5900a3bec9ce1cb60f207aced5a179e02 Mon Sep 17 00:00:00 2001 From: Rafsanul Hasan Date: Thu, 4 Apr 2019 14:10:01 +0600 Subject: [PATCH 38/44] Restored LibMan.Build NuGet Package --- src/Services/Identity/Identity.API/Identity.API.csproj | 1 + src/Web/WebMVC/WebMVC.csproj | 1 + src/Web/WebStatus/WebStatus.csproj | 1 + 3 files changed, 3 insertions(+) diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index ea4bcc0ce..728843f71 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -28,6 +28,7 @@ + diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index 910577d8e..6d958ce09 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -35,6 +35,7 @@ + diff --git a/src/Web/WebStatus/WebStatus.csproj b/src/Web/WebStatus/WebStatus.csproj index 2b5a29b68..e66f0a211 100644 --- a/src/Web/WebStatus/WebStatus.csproj +++ b/src/Web/WebStatus/WebStatus.csproj @@ -22,6 +22,7 @@ + From 089f858ead3a4d33b93aecc88317909a6bc57a1b Mon Sep 17 00:00:00 2001 From: Rafsanul Hasan Date: Fri, 5 Apr 2019 01:01:37 +0600 Subject: [PATCH 39/44] removed version from Microsoft.AspNetCore.App from WebMVC/WebMVC.csproj --- src/Web/WebMVC/WebMVC.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index 6d958ce09..24a37fc75 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -31,7 +31,7 @@ - + From aa7614be5adf76980f0638cff0c997ec5bbe998f Mon Sep 17 00:00:00 2001 From: Nish Anil Date: Fri, 5 Apr 2019 14:21:10 +0530 Subject: [PATCH 40/44] Removed explicit mentions to VS 2017 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2a8f8e22c..b7f92ffa0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# eShopOnContainers - Microservices Architecture and Containers based Reference Application (**BETA state** - Visual Studio 2017 and CLI environments compatible) +# eShopOnContainers - Microservices Architecture and Containers based Reference Application (**BETA state** - Visual Studio and CLI environments compatible) Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers. ## Linux Build Status for 'dev' branch @@ -129,7 +129,7 @@ Finally, those microservices are consumed by multiple client web and mobile apps ## Setting up your development environment for eShopOnContainers -### Visual Studio 2017 and Windows based +### Visual Studio 2017 (or above) and Windows based This is the more straightforward way to get started: https://github.com/dotnet-architecture/eShopOnContainers/wiki/02.-Setting-eShopOnContainers-in-a-Visual-Studio-2017-environment @@ -149,5 +149,5 @@ As mentioned, we'd appreciate your feedback, improvements and ideas. You can create new issues at the issues section, do pull requests and/or send emails to **eshop_feedback@service.microsoft.com** ## Questions -[QUESTION] Answer +1 if the solution is working for you (Through VS2017 or CLI environment): +[QUESTION] Answer +1 if the solution is working for you (Through VS or CLI environment): https://github.com/dotnet/eShopOnContainers/issues/107 From e987dcfb7d60912ee245cf0ede93b1649d0459b4 Mon Sep 17 00:00:00 2001 From: Lee Dumond Date: Mon, 8 Apr 2019 19:25:28 -0500 Subject: [PATCH 41/44] fix references in functional test projects --- .../Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj | 2 ++ .../Catalog.FunctionalTests/Catalog.FunctionalTests.csproj | 2 ++ .../Locations.FunctionalTests/Locations.FunctionalTests.csproj | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj index e781b218d..4fd8cb9ec 100644 --- a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj +++ b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj @@ -17,6 +17,8 @@ + + diff --git a/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj b/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj index 07e9e2991..455dfb0bc 100644 --- a/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj +++ b/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj @@ -33,6 +33,8 @@ + + diff --git a/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj b/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj index 0b7e0a3c4..27898f504 100644 --- a/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj +++ b/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj @@ -17,6 +17,8 @@ + + From 9dd7ed117ed150ab760286bb65bb7922b5778705 Mon Sep 17 00:00:00 2001 From: Lee Dumond Date: Mon, 8 Apr 2019 19:38:49 -0500 Subject: [PATCH 42/44] change form acrion from non-existent Logoff to Logout --- .../Identity/Identity.API/Views/Shared/_LoginPartial.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Identity/Identity.API/Views/Shared/_LoginPartial.cshtml b/src/Services/Identity/Identity.API/Views/Shared/_LoginPartial.cshtml index 3d0a461f5..e110e459c 100644 --- a/src/Services/Identity/Identity.API/Views/Shared/_LoginPartial.cshtml +++ b/src/Services/Identity/Identity.API/Views/Shared/_LoginPartial.cshtml @@ -7,7 +7,7 @@ @if (SignInManager.IsSignedIn(User)) { - +