Browse Source

Merge pull request #37 from volosoft/dev

Dev
pull/40/head
yusufkaratoprak 6 years ago
committed by GitHub
parent
commit
d296988a51
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      .dockerignore
  2. 40
      .vscode/launch.json
  3. 99
      .vscode/tasks.json
  4. 12
      azure-pipelines.yml
  5. 25
      src/.dockerignore
  6. 6
      src/EventHub.BackgroundServices/appsettings.json
  7. 4
      src/EventHub.DbMigrator/appsettings.json
  8. 15
      src/EventHub.HttpApi.Host/.dockerignore
  9. 19
      src/EventHub.HttpApi.Host/Dockerfile
  10. 6
      src/EventHub.HttpApi.Host/appsettings.json
  11. 23
      src/EventHub.HttpApi.Host/manifests/deployment.yml
  12. 11
      src/EventHub.HttpApi.Host/manifests/service.yml
  13. 15
      src/EventHub.IdentityServer/.dockerignore
  14. 19
      src/EventHub.IdentityServer/Dockerfile
  15. 6
      src/EventHub.IdentityServer/appsettings.json
  16. 22
      src/EventHub.IdentityServer/manifests/deployment.yml
  17. 11
      src/EventHub.IdentityServer/manifests/service.yml
  18. 15
      src/EventHub.Web/.dockerignore
  19. 19
      src/EventHub.Web/Dockerfile
  20. 2
      src/EventHub.Web/appsettings.json
  21. 22
      src/EventHub.Web/manifests/deployment.yml
  22. 11
      src/EventHub.Web/manifests/service.yml
  23. 8
      src/common.props

25
.dockerignore

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
README.md

40
.vscode/launch.json

@ -0,0 +1,40 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/EventHub.Web/bin/Debug/net5.0/EventHub.Web.dll",
"args": [],
"cwd": "${workspaceFolder}/src/EventHub.Web",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
},
{
"name": "Docker .NET Core Launch",
"type": "docker",
"request": "launch",
"preLaunchTask": "docker-run: debug",
"netCore": {
"appProject": "${workspaceFolder}/src/EventHub.Web/EventHub.Web.csproj"
}
}
]
}

99
.vscode/tasks.json

@ -0,0 +1,99 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/EventHub.Web/EventHub.Web.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/EventHub.Web/EventHub.Web.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/src/EventHub.Web/EventHub.Web.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"type": "docker-build",
"label": "docker-build: debug",
"dependsOn": [
"build"
],
"dockerBuild": {
"tag": "eventhub:dev",
"target": "base",
"dockerfile": "${workspaceFolder}/src/EventHub.Web/Dockerfile",
"context": "${workspaceFolder}",
"pull": true
},
"netCore": {
"appProject": "${workspaceFolder}/src/EventHub.Web/EventHub.Web.csproj"
}
},
{
"type": "docker-build",
"label": "docker-build: release",
"dependsOn": [
"build"
],
"dockerBuild": {
"tag": "eventhub:latest",
"dockerfile": "${workspaceFolder}/src/EventHub.Web/Dockerfile",
"context": "${workspaceFolder}",
"pull": true
},
"netCore": {
"appProject": "${workspaceFolder}/src/EventHub.Web/EventHub.Web.csproj"
}
},
{
"type": "docker-run",
"label": "docker-run: debug",
"dependsOn": [
"docker-build: debug"
],
"dockerRun": {},
"netCore": {
"appProject": "${workspaceFolder}/src/EventHub.Web/EventHub.Web.csproj",
"enableDebugging": true,
"configureSsl": false
}
},
{
"type": "docker-run",
"label": "docker-run: release",
"dependsOn": [
"docker-build: release"
],
"dockerRun": {},
"netCore": {
"appProject": "${workspaceFolder}/src/EventHub.Web/EventHub.Web.csproj"
}
}
]
}

12
azure-pipelines.yml

@ -5,22 +5,18 @@
trigger: trigger:
- dev - dev
variables: variables:
# Container registry service connection established during pipeline creation # Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: '2b7ea4b4-1757-4911-b98e-6cbb012bf891' dockerRegistryServiceConnection: '0648130a-0d3e-41f3-b92e-fc7f620264e8'
imageRepository: 'voloeventhub' imageRepository: 'voloeventhub'
containerRegistry: 'voloeventhub.azurecr.io' containerRegistry: 'voloeventhub.azurecr.io'
dockerfilePath: '**/Dockerfile' dockerfilePath: '**/Dockerfile'
tag: '$(Build.BuildNumber)' tag: '$(Build.BuildNumber)'
# Agent VM image name # Agent VM image name
vmImageName: 'ubuntu-latest' vmImageName: 'ubuntu-latest'
stages: stages:
- stage: Build - stage: Build
displayName: Build stage displayName: Build stage
@ -52,13 +48,11 @@ stages:
displayName: Deploy displayName: Deploy
pool: pool:
vmImage: $(vmImageName) vmImage: $(vmImageName)
environment: 'volosofteventhub-6985.default' environment: 'volosofteventhub.default'
strategy: strategy:
runOnce: runOnce:
deploy: deploy:
steps: steps:
- task: KubernetesManifest@0 - task: KubernetesManifest@0
displayName: Deploy to Kubernetes cluster displayName: Deploy to Kubernetes cluster
inputs: inputs:
@ -66,8 +60,6 @@ stages:
manifests: | manifests: |
$(Pipeline.Workspace)/manifests/deployment.yml $(Pipeline.Workspace)/manifests/deployment.yml
$(Pipeline.Workspace)/manifests/service.yml $(Pipeline.Workspace)/manifests/service.yml
imagePullSecrets: |
$(imagePullSecret)
containers: | containers: |
$(containerRegistry)/$(imageRepository):$(tag) $(containerRegistry)/$(imageRepository):$(tag)

25
src/.dockerignore

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
README.md

6
src/EventHub.BackgroundServices/appsettings.json

@ -1,9 +1,11 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Host=localhost;Database=EventHub;Username=root;Password=root;Port=5432"
"Default": "Server=tcp:volosofteventhub.database.windows.net,1433;Initial Catalog=volosofteventhub;Persist Security Info=False;User ID=volosoft;Password=@Palandoken2021;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
}, },
"Redis": { "Redis": {
"Configuration": "127.0.0.1" "Configuration": "Server=tcp:volosofteventhub.database.windows.net,1433;Initial Catalog=volosofteventhub;Persist Security Info=False;User ID=volosoft;Password=@Palandoken2021;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
}, },
"StringEncryption": { "StringEncryption": {
"DefaultPassPhrase": "TxVIZFPxK33czbbv" "DefaultPassPhrase": "TxVIZFPxK33czbbv"

4
src/EventHub.DbMigrator/appsettings.json

@ -1,6 +1,8 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Host=localhost;Database=EventHub;Username=root;Password=root;Port=5432"
"Default": "Server=tcp:volosofteventhub.database.windows.net,1433;Initial Catalog=volosofteventhub;Persist Security Info=False;User ID=volosoft;Password=@Palandoken2021;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
}, },
"IdentityServer": { "IdentityServer": {
"Clients": { "Clients": {

15
src/EventHub.HttpApi.Host/.dockerignore

@ -0,0 +1,15 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
.env
*/bin
*/obj
bin
obj
README.md
LICENSE
.vscode

19
src/EventHub.HttpApi.Host/Dockerfile

@ -0,0 +1,19 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 5002
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["src/EventHub.HttpApi.Host/EventHub.HttpApi.Host.csproj", "src/EventHub.HttpApi.Host/"]
RUN dotnet restore "src/EventHub.HttpApi.Host/EventHub.HttpApi.Host.csproj"
COPY . .
WORKDIR "/src/src/EventHub.HttpApi.Host"
RUN dotnet build "EventHub.HttpApi.Host.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "EventHub.HttpApi.Host.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "EventHub.HttpApi.Host.dll"]

6
src/EventHub.HttpApi.Host/appsettings.json

@ -3,10 +3,12 @@
"CorsOrigins": "https://*.EventHub.com,https://localhost:44307,https://localhost:44308" "CorsOrigins": "https://*.EventHub.com,https://localhost:44307,https://localhost:44308"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Host=localhost;Database=EventHub;Username=root;Password=root;Port=5432"
"Default": "Server=tcp:volosofteventhub.database.windows.net,1433;Initial Catalog=volosofteventhub;Persist Security Info=False;User ID=volosoft;Password=@Palandoken2021;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
}, },
"Redis": { "Redis": {
"Configuration": "127.0.0.1" "Configuration": "volosofteventhub.redis.cache.windows.net:6380,password=9Kc6E1lbwy5c+RHR1KZS26JPydYR5SeR8UixdECQWv4=,ssl=True,abortConnect=False"
}, },
"AuthServer": { "AuthServer": {
"Authority": "https://localhost:44313", "Authority": "https://localhost:44313",

23
src/EventHub.HttpApi.Host/manifests/deployment.yml

@ -0,0 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: volosoft-eventhub-httpapi-host-deployment
spec:
selector:
matchLabels:
app: volosoft-eventhub-httpapi-host-pod
replicas: 2
template:
metadata:
labels:
app: volosoft-eventhub-httpapi-host-pod
spec:
containers:
- name: volosoft-eventhub-httpapi-host-container
image: voloeventhubhttpapihost.azurecr.io/voloeventhubhttpapihost:v1
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 5002

11
src/EventHub.HttpApi.Host/manifests/service.yml

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: volosoft-eventhub-httpapi-host-service
spec:
selector:
app: volosoft-eventhub-httpapi-host-pod
ports:
- port: 80
targetPort: 80
type: LoadBalancer

15
src/EventHub.IdentityServer/.dockerignore

@ -0,0 +1,15 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
.env
*/bin
*/obj
bin
obj
README.md
LICENSE
.vscode

19
src/EventHub.IdentityServer/Dockerfile

@ -0,0 +1,19 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 5001
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["src/EventHub.IdentityServer/EventHub.IdentityServer.csproj", "src/EventHub.IdentityServer/"]
RUN dotnet restore "src/EventHub.IdentityServer/EventHub.IdentityServer.csproj"
COPY . .
WORKDIR "/src/src/EventHub.IdentityServer"
RUN dotnet build "EventHub.IdentityServer.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "EventHub.IdentityServer.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "EventHub.IdentityServer.dll"]

6
src/EventHub.IdentityServer/appsettings.json

@ -5,10 +5,12 @@
"RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307" "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Host=localhost;Database=EventHub;Username=root;Password=root;Port=5432"
"Default": "Server=tcp:volosofteventhub.database.windows.net,1433;Initial Catalog=volosofteventhub;Persist Security Info=False;User ID=volosoft;Password=@Palandoken2021;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
}, },
"Redis": { "Redis": {
"Configuration": "127.0.0.1" "Configuration": "volosofteventhub.redis.cache.windows.net:6380,password=9Kc6E1lbwy5c+RHR1KZS26JPydYR5SeR8UixdECQWv4=,ssl=True,abortConnect=False"
}, },
"StringEncryption": { "StringEncryption": {
"DefaultPassPhrase": "TxVIZFPxK33czbbv" "DefaultPassPhrase": "TxVIZFPxK33czbbv"

22
src/EventHub.IdentityServer/manifests/deployment.yml

@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: volosoft-eventhub-identityserver-deployment
spec:
selector:
matchLabels:
app: volosoft-eventhub-identityserver-pod
template:
metadata:
labels:
app: volosoft-eventhub-identityserver-pod
spec:
containers:
- name: volosoft-eventhub-identityserver-container
image: voloeventhubidentityserver.azurecr.io/voloeventhubidentityserver:v1
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 5001

11
src/EventHub.IdentityServer/manifests/service.yml

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: volosoft-eventhub-identityserver-service
spec:
selector:
app: volosoft-eventhub-identityserver-pod
ports:
- port: 80
targetPort: 80
type: LoadBalancer

15
src/EventHub.Web/.dockerignore

@ -0,0 +1,15 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
.env
*/bin
*/obj
bin
obj
README.md
LICENSE
.vscode

19
src/EventHub.Web/Dockerfile

@ -0,0 +1,19 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["src/EventHub.Web/EventHub.Web.csproj", "src/EventHub.Web/"]
RUN dotnet restore "src/EventHub.Web/EventHub.Web.csproj"
COPY . .
WORKDIR "/src/src/EventHub.Web"
RUN dotnet build "EventHub.Web.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "EventHub.Web.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "EventHub.Web.dll"]

2
src/EventHub.Web/appsettings.json

@ -8,7 +8,7 @@
} }
}, },
"Redis": { "Redis": {
"Configuration": "127.0.0.1" "Configuration": "volosofteventhub.redis.cache.windows.net:6380,password=9Kc6E1lbwy5c+RHR1KZS26JPydYR5SeR8UixdECQWv4=,ssl=True,abortConnect=False"
}, },
"AuthServer": { "AuthServer": {
"Authority": "https://localhost:44313", "Authority": "https://localhost:44313",

22
src/EventHub.Web/manifests/deployment.yml

@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: volosoft-eventhub-web-deployment
spec:
selector:
matchLabels:
app: volosoft-eventhub-web-pod
template:
metadata:
labels:
app: volosoft-eventhub-web-pod
spec:
containers:
- name: volosoft-eventhub-web-container
image: voloeventhub.azurecr.io/voloeventhub:v1
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 80

11
src/EventHub.Web/manifests/service.yml

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: volosoft-eventhub-web-service
spec:
selector:
app: volosoft-eventhub-web-pod
ports:
- port: 8080
targetPort: 80
type: ClusterIP

8
src/common.props

@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>1.0.0</Version>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
<AbpProjectType>app</AbpProjectType>
</PropertyGroup>
</Project>
Loading…
Cancel
Save