mirror of https://github.com/dotnet/tye.git
committed by
GitHub
26 changed files with 412 additions and 63 deletions
@ -0,0 +1,20 @@ |
|||||
|
// Licensed to the .NET Foundation under one or more agreements.
|
||||
|
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
// See the LICENSE file in the project root for more information.
|
||||
|
|
||||
|
namespace Microsoft.Tye |
||||
|
{ |
||||
|
public class DockerFileServiceBuilder : ProjectServiceBuilder |
||||
|
{ |
||||
|
public DockerFileServiceBuilder(string name, string image) |
||||
|
: base(name) |
||||
|
{ |
||||
|
Image = image; |
||||
|
} |
||||
|
public string Image { get; set; } |
||||
|
|
||||
|
public string? DockerFile { get; set; } |
||||
|
|
||||
|
public string? DockerFileContext { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
// Licensed to the .NET Foundation under one or more agreements.
|
||||
|
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
// See the LICENSE file in the project root for more information.
|
||||
|
|
||||
|
using System.Collections.Generic; |
||||
|
using System.IO; |
||||
|
|
||||
|
namespace Microsoft.Tye |
||||
|
{ |
||||
|
public class DotnetProjectServiceBuilder : ProjectServiceBuilder |
||||
|
{ |
||||
|
public DotnetProjectServiceBuilder(string name, FileInfo projectFile) |
||||
|
: base(name) |
||||
|
{ |
||||
|
ProjectFile = projectFile; |
||||
|
} |
||||
|
|
||||
|
public FileInfo ProjectFile { get; } |
||||
|
public FrameworkCollection Frameworks { get; } = new FrameworkCollection(); |
||||
|
|
||||
|
// These is always set on the ApplicationFactory codepath.
|
||||
|
public string TargetFrameworkName { get; set; } = default!; |
||||
|
public string TargetFrameworkVersion { get; set; } = default!; |
||||
|
public string TargetFramework { get; set; } = default!; |
||||
|
public string[] TargetFrameworks { get; set; } = default!; |
||||
|
public string Version { get; set; } = default!; |
||||
|
public string TargetPath { get; set; } = default!; |
||||
|
public string RunCommand { get; set; } = default!; |
||||
|
public string RunArguments { get; set; } = default!; |
||||
|
public string AssemblyName { get; set; } = default!; |
||||
|
public string PublishDir { get; set; } = default!; |
||||
|
public string IntermediateOutputPath { get; set; } = default!; |
||||
|
public Dictionary<string, string> BuildProperties { get; } = new Dictionary<string, string>(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,109 @@ |
|||||
|
kind: Deployment |
||||
|
apiVersion: apps/v1 |
||||
|
metadata: |
||||
|
name: backend |
||||
|
labels: |
||||
|
app.kubernetes.io/name: 'backend' |
||||
|
app.kubernetes.io/part-of: 'frontend-backend' |
||||
|
spec: |
||||
|
replicas: 1 |
||||
|
selector: |
||||
|
matchLabels: |
||||
|
app.kubernetes.io/name: backend |
||||
|
template: |
||||
|
metadata: |
||||
|
labels: |
||||
|
app.kubernetes.io/name: 'backend' |
||||
|
app.kubernetes.io/part-of: 'frontend-backend' |
||||
|
spec: |
||||
|
containers: |
||||
|
- name: backend |
||||
|
image: backend:latest |
||||
|
imagePullPolicy: Always |
||||
|
env: |
||||
|
- name: ASPNETCORE_URLS |
||||
|
value: 'http://*' |
||||
|
- name: PORT |
||||
|
value: '80' |
||||
|
- name: SERVICE__FRONTEND__PROTOCOL |
||||
|
value: 'http' |
||||
|
- name: SERVICE__FRONTEND__PORT |
||||
|
value: '80' |
||||
|
- name: SERVICE__FRONTEND__HOST |
||||
|
value: 'frontend' |
||||
|
ports: |
||||
|
- containerPort: 80 |
||||
|
... |
||||
|
--- |
||||
|
kind: Service |
||||
|
apiVersion: v1 |
||||
|
metadata: |
||||
|
name: backend |
||||
|
labels: |
||||
|
app.kubernetes.io/name: 'backend' |
||||
|
app.kubernetes.io/part-of: 'frontend-backend' |
||||
|
spec: |
||||
|
selector: |
||||
|
app.kubernetes.io/name: backend |
||||
|
type: ClusterIP |
||||
|
ports: |
||||
|
- name: http |
||||
|
protocol: TCP |
||||
|
port: 80 |
||||
|
targetPort: 80 |
||||
|
... |
||||
|
--- |
||||
|
kind: Deployment |
||||
|
apiVersion: apps/v1 |
||||
|
metadata: |
||||
|
name: frontend |
||||
|
labels: |
||||
|
app.kubernetes.io/name: 'frontend' |
||||
|
app.kubernetes.io/part-of: 'frontend-backend' |
||||
|
spec: |
||||
|
replicas: 1 |
||||
|
selector: |
||||
|
matchLabels: |
||||
|
app.kubernetes.io/name: frontend |
||||
|
template: |
||||
|
metadata: |
||||
|
labels: |
||||
|
app.kubernetes.io/name: 'frontend' |
||||
|
app.kubernetes.io/part-of: 'frontend-backend' |
||||
|
spec: |
||||
|
containers: |
||||
|
- name: frontend |
||||
|
image: frontend:1.0.0 |
||||
|
imagePullPolicy: Always |
||||
|
env: |
||||
|
- name: ASPNETCORE_URLS |
||||
|
value: 'http://*' |
||||
|
- name: PORT |
||||
|
value: '80' |
||||
|
- name: SERVICE__BACKEND__PROTOCOL |
||||
|
value: 'http' |
||||
|
- name: SERVICE__BACKEND__PORT |
||||
|
value: '80' |
||||
|
- name: SERVICE__BACKEND__HOST |
||||
|
value: 'backend' |
||||
|
ports: |
||||
|
- containerPort: 80 |
||||
|
... |
||||
|
--- |
||||
|
kind: Service |
||||
|
apiVersion: v1 |
||||
|
metadata: |
||||
|
name: frontend |
||||
|
labels: |
||||
|
app.kubernetes.io/name: 'frontend' |
||||
|
app.kubernetes.io/part-of: 'frontend-backend' |
||||
|
spec: |
||||
|
selector: |
||||
|
app.kubernetes.io/name: frontend |
||||
|
type: ClusterIP |
||||
|
ports: |
||||
|
- name: http |
||||
|
protocol: TCP |
||||
|
port: 80 |
||||
|
targetPort: 80 |
||||
|
... |
||||
Loading…
Reference in new issue