From 1b89edec1517080293f5773fd08ec9a40e958a64 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Wed, 29 Aug 2018 11:27:03 +0200 Subject: [PATCH] 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" } } }