Files
caprover/src/models/AppDefinition.ts
T
2019-03-13 22:50:03 -07:00

101 lines
2.0 KiB
TypeScript

type IAllAppDefinitions = IHashMapGeneric<IAppDef>
interface IAppEnvVar {
key: string
value: string
}
interface IAppVolume {
containerPath: string
volumeName?: string
hostPath?: string
mode?: string
}
interface IAppPort {
containerPort: number
hostPort: number
protocol?: 'udp' | 'tcp'
publishMode?: 'ingress' | 'host'
}
interface RepoInfo {
repo: string
branch: string
user: string
sshKey?: string
password: string
}
interface RepoInfoEncrypted {
repo: string
branch: string
user: string
sshKeyEncrypted?: string
passwordEncrypted: string
}
interface IAppVersion {
version: number
deployedImageName?: string // empty if the deploy is not completed
timeStamp: string
gitHash: string | undefined
}
interface IAppCustomDomain {
publicDomain: string
hasSsl: boolean
}
interface IAppDefinitionBase {
deployedVersion: number
notExposeAsWebApp: boolean
hasPersistentData: boolean
hasDefaultSubDomainSsl: boolean
containerHttpPort?: number
captainDefinitionRelativeFilePath: string
forceSsl: boolean
nodeId?: string
instanceCount: number
preDeployFunction?: string
customNginxConfig?: string
networks: string[]
customDomain: IAppCustomDomain[]
ports: IAppPort[]
volumes: IAppVolume[]
envVars: IAppEnvVar[]
versions: IAppVersion[]
}
interface IAppDef extends IAppDefinitionBase {
appPushWebhook?: {
tokenVersion: string
repoInfo: RepoInfo
pushWebhookToken: string
}
httpAuth?: {
user: string
password?: string
passwordHashed?: string
}
appName?: string
isAppBuilding?: boolean
}
interface IAppDefSaved extends IAppDefinitionBase {
appPushWebhook:
| {
tokenVersion: string
repoInfo: RepoInfoEncrypted
pushWebhookToken: string
}
| undefined
httpAuth?: {
user: string
passwordHashed?: string
}
}