mirror of https://github.com/abpframework/eventhub
17 changed files with 167 additions and 28 deletions
@ -0,0 +1,21 @@ |
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base |
|||
WORKDIR /app |
|||
EXPOSE 80 |
|||
EXPOSE 443 |
|||
|
|||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build |
|||
WORKDIR /src |
|||
COPY ["src/EventHub.Admin.Web/EventHub.Admin.Web.csproj", "src/EventHub.Admin.Web/"] |
|||
RUN dotnet restore "src/EventHub.Admin.Web/EventHub.Admin.Web.csproj" |
|||
COPY . . |
|||
WORKDIR "/src/src/EventHub.Admin.Web" |
|||
|
|||
RUN dotnet build "EventHub.Admin.Web.csproj" -c Release -o /app |
|||
|
|||
FROM build AS publish |
|||
RUN dotnet publish "EventHub.Admin.Web.csproj" -c Release -o /app |
|||
|
|||
FROM base AS final |
|||
WORKDIR /app |
|||
COPY --from=publish /app . |
|||
ENTRYPOINT ["dotnet", "EventHub.Admin.Web.dll"] |
|||
@ -0,0 +1,67 @@ |
|||
trigger: |
|||
- dev |
|||
|
|||
|
|||
variables: |
|||
|
|||
# Container registry service connection established during pipeline creation |
|||
dockerRegistryServiceConnection: '855289e7-1034-4e42-90b4-38c072ecefcb' |
|||
imageRepository: 'voloeventhub' |
|||
containerRegistry: 'voloeventhub.azurecr.io' |
|||
dockerfilePath: '**/Dockerfile.EventHub.Web' |
|||
tag: '$(Build.BuildNumber)' |
|||
|
|||
|
|||
# Agent VM image name |
|||
vmImageName: 'ubuntu-latest' |
|||
|
|||
|
|||
stages: |
|||
- stage: Build |
|||
displayName: Build stage |
|||
jobs: |
|||
- job: Build |
|||
displayName: Build |
|||
pool: |
|||
vmImage: $(vmImageName) |
|||
steps: |
|||
- task: Docker@2 |
|||
displayName: Build and push an image to container registry |
|||
inputs: |
|||
command: buildAndPush |
|||
repository: $(imageRepository) |
|||
dockerfile: $(dockerfilePath) |
|||
containerRegistry: $(dockerRegistryServiceConnection) |
|||
tags: | |
|||
$(tag) |
|||
|
|||
- upload: manifests |
|||
artifact: manifests |
|||
|
|||
- stage: Deploy |
|||
displayName: Deploy stage |
|||
dependsOn: Build |
|||
|
|||
jobs: |
|||
- deployment: Deploy |
|||
displayName: Deploy-EventHub-Web |
|||
pool: |
|||
vmImage: $(vmImageName) |
|||
environment: 'volosofteventhub-3839.default' |
|||
strategy: |
|||
runOnce: |
|||
deploy: |
|||
steps: |
|||
|
|||
|
|||
- task: KubernetesManifest@0 |
|||
displayName: Deploy to Kubernetes cluster |
|||
inputs: |
|||
action: deploy |
|||
manifests: | |
|||
$(Pipeline.Workspace)/manifests/deployment.eventhub.web.yml |
|||
$(Pipeline.Workspace)/manifests/service.eventhub.web.yml |
|||
|
|||
containers: | |
|||
$(containerRegistry)/$(imageRepository):$(tag) |
|||
|
|||
@ -0,0 +1,23 @@ |
|||
apiVersion: apps/v1 |
|||
kind: Deployment |
|||
metadata: |
|||
name: admin |
|||
spec: |
|||
selector: |
|||
matchLabels: |
|||
app: admin |
|||
template: |
|||
metadata: |
|||
labels: |
|||
app: admin |
|||
spec: |
|||
containers: |
|||
- name: admin |
|||
image: eventhubregistry.azurecr.io/eventhubadmin:v2 |
|||
imagePullPolicy: Always |
|||
resources: |
|||
requests: |
|||
memory: "128Mi" |
|||
cpu: "500m" |
|||
ports: |
|||
- containerPort: 80 |
|||
@ -0,0 +1,25 @@ |
|||
apiVersion: networking.k8s.io/v1 |
|||
kind: Ingress |
|||
metadata: |
|||
name: admin |
|||
annotations: |
|||
kubernetes.io/ingress.class: nginx |
|||
nginx.ingress.kubernetes.io/ssl-redirect: "true" |
|||
cert-manager.io/issuer: letsencrypt-prod |
|||
spec: |
|||
tls: |
|||
- hosts: |
|||
- admin.openeventhub.com |
|||
secretName: admin-tls |
|||
rules: |
|||
- host: admin.openeventhub.com |
|||
http: |
|||
paths: |
|||
- backend: |
|||
service: |
|||
name: admin |
|||
port: |
|||
number: 80 |
|||
path: / |
|||
pathType: Prefix |
|||
|
|||
@ -0,0 +1,11 @@ |
|||
apiVersion: v1 |
|||
kind: Service |
|||
metadata: |
|||
name: admin |
|||
spec: |
|||
selector: |
|||
app: admin |
|||
ports: |
|||
- port: 80 |
|||
targetPort: 80 |
|||
type: ClusterIP |
|||
Loading…
Reference in new issue