Update project deployer relation in db
This commit is contained in:
parent
f61a447515
commit
380cc0cba6
@ -10,4 +10,7 @@ export class Deployer {
|
|||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
deployerApiUrl!: string;
|
deployerApiUrl!: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
baseDomain!: string;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ import { User } from './User';
|
|||||||
import { Organization } from './Organization';
|
import { Organization } from './Organization';
|
||||||
import { ProjectMember } from './ProjectMember';
|
import { ProjectMember } from './ProjectMember';
|
||||||
import { Deployment } from './Deployment';
|
import { Deployment } from './Deployment';
|
||||||
|
import { Deployer } from './Deployer';
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class Project {
|
export class Project {
|
||||||
@ -49,8 +50,8 @@ export class Project {
|
|||||||
@Column('varchar', { nullable: true })
|
@Column('varchar', { nullable: true })
|
||||||
auctionId!: string | null;
|
auctionId!: string | null;
|
||||||
|
|
||||||
@Column({ type: 'simple-array', nullable: true })
|
@OneToMany(() => Deployer, (deployer) => deployer.deployerId)
|
||||||
deployerLrns!: string[] | null;
|
deployers!: Deployer[];
|
||||||
|
|
||||||
@Column('boolean', { default: false, nullable: true })
|
@Column('boolean', { default: false, nullable: true })
|
||||||
fundsReleased!: boolean;
|
fundsReleased!: boolean;
|
||||||
@ -70,9 +71,6 @@ export class Project {
|
|||||||
@Column('varchar')
|
@Column('varchar')
|
||||||
icon!: string;
|
icon!: string;
|
||||||
|
|
||||||
@Column({ type: 'simple-array', nullable: true })
|
|
||||||
baseDomains!: string[] | null;
|
|
||||||
|
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
createdAt!: Date;
|
createdAt!: Date;
|
||||||
|
|
||||||
|
@ -330,10 +330,10 @@ export class Service {
|
|||||||
await this.db.addDeployer(deployerData);
|
await this.db.addDeployer(deployerData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update project with deployer LRNs
|
// TODO:Update project with deployer LRNs
|
||||||
await this.db.updateProjectById(project.id!, {
|
// await this.db.updateProjectById(project.id!, {
|
||||||
deployerLrns
|
// deployerLrns
|
||||||
});
|
// });
|
||||||
|
|
||||||
for (const deployer of deployerIds) {
|
for (const deployer of deployerIds) {
|
||||||
log(`Creating deployment for deployer LRN ${deployer}`);
|
log(`Creating deployment for deployer LRN ${deployer}`);
|
||||||
@ -889,7 +889,7 @@ export class Service {
|
|||||||
await this.updateProject(project.id, { auctionId: applicationDeploymentAuctionId })
|
await this.updateProject(project.id, { auctionId: applicationDeploymentAuctionId })
|
||||||
} else {
|
} else {
|
||||||
await this.createDeployment(user.id, octokit, deploymentData);
|
await this.createDeployment(user.id, octokit, deploymentData);
|
||||||
await this.updateProject(project.id, { deployerLrns: [lrn!] })
|
// await this.updateProject(project.id, { deployerLrns: [lrn!] })
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.createRepoHook(octokit, project);
|
await this.createRepoHook(octokit, project);
|
||||||
@ -960,13 +960,13 @@ export class Service {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Store deployer in project
|
// TODO: Store deployer in project
|
||||||
const deployers = project.deployerLrns;
|
// const deployers = project.deployerLrns;
|
||||||
if (!deployers) {
|
// if (!deployers) {
|
||||||
log(`No deployer present for project ${project.id}`)
|
// log(`No deployer present for project ${project.id}`)
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
for (const deployer of deployers) {
|
// for (const deployer of deployers) {
|
||||||
// Create deployment with branch and latest commit in GitHub data
|
// Create deployment with branch and latest commit in GitHub data
|
||||||
await this.createDeployment(project.ownerId, octokit,
|
await this.createDeployment(project.ownerId, octokit,
|
||||||
{
|
{
|
||||||
@ -982,7 +982,7 @@ export class Service {
|
|||||||
// deployer: deployer
|
// deployer: deployer
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user