From b2252dc4ec5044d83b78b5e440fa39a5971ee90d Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 25 Feb 2019 16:48:41 +0100 Subject: [PATCH] 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