|
@@ -1,22 +1,23 @@
|
|
|
|
|
+import { Service, ServiceType } from "@porter-dev/api-contracts";
|
|
|
import { match } from "ts-pattern";
|
|
import { match } from "ts-pattern";
|
|
|
import { z } from "zod";
|
|
import { z } from "zod";
|
|
|
|
|
+
|
|
|
|
|
+import { BuildOptions } from "./build";
|
|
|
import {
|
|
import {
|
|
|
- SerializedAutoscaling,
|
|
|
|
|
- SerializedHealthcheck,
|
|
|
|
|
autoscalingValidator,
|
|
autoscalingValidator,
|
|
|
- healthcheckValidator,
|
|
|
|
|
deserializeAutoscaling,
|
|
deserializeAutoscaling,
|
|
|
deserializeHealthCheck,
|
|
deserializeHealthCheck,
|
|
|
|
|
+ domainsValidator,
|
|
|
|
|
+ healthcheckValidator,
|
|
|
serializeAutoscaling,
|
|
serializeAutoscaling,
|
|
|
|
|
+ SerializedAutoscaling,
|
|
|
|
|
+ SerializedHealthcheck,
|
|
|
serializeHealth,
|
|
serializeHealth,
|
|
|
- domainsValidator,
|
|
|
|
|
- serviceStringValidator,
|
|
|
|
|
- serviceNumberValidator,
|
|
|
|
|
serviceBooleanValidator,
|
|
serviceBooleanValidator,
|
|
|
ServiceField,
|
|
ServiceField,
|
|
|
|
|
+ serviceNumberValidator,
|
|
|
|
|
+ serviceStringValidator,
|
|
|
} from "./values";
|
|
} from "./values";
|
|
|
-import { Service, ServiceType } from "@porter-dev/api-contracts";
|
|
|
|
|
-import { BuildOptions } from "./build";
|
|
|
|
|
|
|
|
|
|
export type DetectedServices = {
|
|
export type DetectedServices = {
|
|
|
services: ClientService[];
|
|
services: ClientService[];
|
|
@@ -520,7 +521,7 @@ export function serializedServiceFromProto({
|
|
|
.with({ case: "webConfig" }, ({ value }) => ({
|
|
.with({ case: "webConfig" }, ({ value }) => ({
|
|
|
...service,
|
|
...service,
|
|
|
name,
|
|
name,
|
|
|
- run: service.runOptional ? service.runOptional : "",
|
|
|
|
|
|
|
+ run: service.runOptional ?? service.run,
|
|
|
config: {
|
|
config: {
|
|
|
type: "web" as const,
|
|
type: "web" as const,
|
|
|
autoscaling: value.autoscaling ? value.autoscaling : undefined,
|
|
autoscaling: value.autoscaling ? value.autoscaling : undefined,
|
|
@@ -531,7 +532,7 @@ export function serializedServiceFromProto({
|
|
|
.with({ case: "workerConfig" }, ({ value }) => ({
|
|
.with({ case: "workerConfig" }, ({ value }) => ({
|
|
|
...service,
|
|
...service,
|
|
|
name,
|
|
name,
|
|
|
- run: service.runOptional ? service.runOptional : "",
|
|
|
|
|
|
|
+ run: service.runOptional ?? service.run,
|
|
|
config: {
|
|
config: {
|
|
|
type: "worker" as const,
|
|
type: "worker" as const,
|
|
|
autoscaling: value.autoscaling ? value.autoscaling : undefined,
|
|
autoscaling: value.autoscaling ? value.autoscaling : undefined,
|
|
@@ -543,7 +544,7 @@ export function serializedServiceFromProto({
|
|
|
? {
|
|
? {
|
|
|
...service,
|
|
...service,
|
|
|
name,
|
|
name,
|
|
|
- run: service.runOptional ? service.runOptional : "",
|
|
|
|
|
|
|
+ run: service.runOptional ?? service.run,
|
|
|
config: {
|
|
config: {
|
|
|
type: "predeploy" as const,
|
|
type: "predeploy" as const,
|
|
|
},
|
|
},
|
|
@@ -551,7 +552,7 @@ export function serializedServiceFromProto({
|
|
|
: {
|
|
: {
|
|
|
...service,
|
|
...service,
|
|
|
name,
|
|
name,
|
|
|
- run: service.runOptional ? service.runOptional : "",
|
|
|
|
|
|
|
+ run: service.runOptional ?? service.run,
|
|
|
config: {
|
|
config: {
|
|
|
type: "job" as const,
|
|
type: "job" as const,
|
|
|
...value,
|
|
...value,
|