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