default all owners to empty array

This commit is contained in:
mbecker20
2022-04-13 13:24:25 -07:00
parent 38320a4f8b
commit 17a255a106
3 changed files with 7 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ export default function deploymentModel() {
const schema = new Schema<Deployment>({
name: { type: String, unique: true, index: true },
containerName: { type: String, unique: true, index: true }, // for auto pull of frontend repo as well
owners: [String],
owners: { type: [String], default: [] },
serverID: { type: String, index: true },
buildID: { type: String, index: true }, // if deploying a monitor build
/* to create docker run command */
@@ -28,11 +28,14 @@ export default function deploymentModel() {
restart: String,
postImage: String, // interpolated into run command after the image String
containerUser: String, // after -u in the run command
dockerAccount: String,
/* to manage repo for static frontend, mounted as a volume */
repo: String,
branch: String,
containerMount: String, // the file path to mount repo on inside the container
subfolder: String,
githubAccount: String,
containerMount: String, // the file path to mount repo on inside the container
repoMount: String,
});
return model("Deployment", schema)

View File

@@ -19,7 +19,7 @@ const builds = fp((app: FastifyInstance, _: {}, done: () => void) => {
cliBuild: Command,
dockerBuildArgs: DockerBuildArgs,
dockerAccount: String,
owners: [String],
owners: { type: [String], default: [] },
});
app.decorate("builds", model(app, "Build", schema));

View File

@@ -9,7 +9,7 @@ const deployments = fp((app: FastifyInstance, _: {}, done: () => void) => {
const schema = new Schema<Deployment>({
name: { type: String, unique: true, index: true },
containerName: { type: String, unique: true, index: true }, // for auto pull of frontend repo as well
owners: [String],
owners: { type: [String], default: [] },
serverID: { type: String, index: true },
buildID: { type: String, index: true }, // if deploying a monitor build
/* to create docker run command */