Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

55 lines
1.1 KiB

const newid = require("../../../db/newid")
const { getAppId } = require("@budibase/backend-core/context")
/**
* This is used to pass around information about the deployment that is occurring
*/
class Deployment {
constructor(id = null) {
this._id = id || newid()
}
setVerification(verification) {
if (!verification) {
return
}
this.verification = verification
}
getVerification() {
return this.verification
}
setStatus(status, err = null) {
this.status = status
if (err) {
this.err = err
}
}
fromJSON(json) {
if (json.verification) {
this.setVerification(json.verification)
}
if (json.status) {
this.setStatus(json.status, json.err)
}
}
getJSON() {
const obj = {
_id: this._id,
appId: getAppId(),
status: this.status,
}
if (this.err) {
obj.err = this.err
}
if (this.verification && this.verification.cfDistribution) {
obj.cfDistribution = this.verification.cfDistribution
}
return obj
}
}
module.exports = Deployment