Update deployment request for multiple deployers
This commit is contained in:
parent
3ea43eab42
commit
be1857cf74
@ -688,7 +688,6 @@ export class Service {
|
|||||||
const { repo, repoUrl } = await getRepoDetails(octokit, data.project.repository, data.commitHash);
|
const { repo, repoUrl } = await getRepoDetails(octokit, data.project.repository, data.commitHash);
|
||||||
const environmentVariablesObj = await this.getEnvVariables(data.project!.id!);
|
const environmentVariablesObj = await this.getEnvVariables(data.project!.id!);
|
||||||
|
|
||||||
|
|
||||||
// To set project DNS
|
// To set project DNS
|
||||||
if (data.environment === Environment.Production) {
|
if (data.environment === Environment.Production) {
|
||||||
const dnsDeployment = await this.createDeploymentFromData(userId, data, deployer!.deployerLrn!, applicationRecordId, applicationRecordData, true);
|
const dnsDeployment = await this.createDeploymentFromData(userId, data, deployer!.deployerLrn!, applicationRecordId, applicationRecordData, true);
|
||||||
@ -782,12 +781,15 @@ export class Service {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const deployment = await this.createDeploymentFromData(project.ownerId!, deploymentData, deployerLrn, applicationRecordId, applicationRecordData, false);
|
const deployment = await this.createDeploymentFromData(project.ownerId!, deploymentData, deployerLrn, applicationRecordId, applicationRecordData, false);
|
||||||
const dnsDeployment = await this.createDeploymentFromData(project.ownerId!, deploymentData, deployerLrn, applicationRecordId, applicationRecordData, true);
|
|
||||||
const address = await this.getAddress();
|
const address = await this.getAddress();
|
||||||
|
|
||||||
const environmentVariablesObj = await this.getEnvVariables(project!.id!);
|
const environmentVariablesObj = await this.getEnvVariables(project!.id!);
|
||||||
// To set project DNS
|
// To set project DNS
|
||||||
if (deploymentData.environment === Environment.Production) {
|
if (deploymentData.environment === Environment.Production) {
|
||||||
|
const dnsDeployment = await this.createDeploymentFromData(project.ownerId!, deploymentData, deployerLrn, applicationRecordId, applicationRecordData, true);
|
||||||
|
// If a custom domain is present then use that as the DNS in the deployment request
|
||||||
|
const customDomain = await this.db.getOldestDomainByProjectId(project!.id!);
|
||||||
|
|
||||||
// On deleting deployment later, project DNS deployment is also deleted
|
// On deleting deployment later, project DNS deployment is also deleted
|
||||||
// So publish project DNS deployment first so that ApplicationDeploymentRecord for the same is available when deleting deployment later
|
// So publish project DNS deployment first so that ApplicationDeploymentRecord for the same is available when deleting deployment later
|
||||||
const { applicationDeploymentRequestId, applicationDeploymentRequestData } =
|
const { applicationDeploymentRequestId, applicationDeploymentRequestData } =
|
||||||
@ -796,7 +798,7 @@ export class Service {
|
|||||||
appName: repo,
|
appName: repo,
|
||||||
repository: repoUrl,
|
repository: repoUrl,
|
||||||
environmentVariables: environmentVariablesObj,
|
environmentVariables: environmentVariablesObj,
|
||||||
dns: `${dnsDeployment.project.name}`,
|
dns: customDomain?.name ?? `${dnsDeployment.project.name}`,
|
||||||
auctionId: project.auctionId!,
|
auctionId: project.auctionId!,
|
||||||
lrn: deployerLrn,
|
lrn: deployerLrn,
|
||||||
apiUrl: deployer!.deployerApiUrl!,
|
apiUrl: deployer!.deployerApiUrl!,
|
||||||
|
Loading…
Reference in New Issue
Block a user