Skip to content

Commit

Permalink
fix: envs for deployment (#6482)
Browse files Browse the repository at this point in the history
* feat: added buildStatus to pipeline list

* fix: corrected env in cdk

* fix: corrected script envs for hosted zone

Co-authored-by: Josh Balfour <[email protected]>
  • Loading branch information
bashleigh and joshbalfour authored Mar 25, 2022
1 parent 149fee4 commit f16f910
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/cli/src/commands/pipeline/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ export class PipelineList extends AbstractCommand {
appType: pipeline.appType,
appId: pipeline.appId,
repository: pipeline.repository,
buildStatus: pipeline.buildStatus,
created: shleemy(new Date(pipeline.created as string)).forHumans,
})),
['id', 'name', 'appType', 'version', 'appId', 'repository', 'created'],
['id', 'name', 'appType', 'version', 'appId', 'buildStatus', 'repository', 'created'],
)
}
}
3 changes: 1 addition & 2 deletions packages/deployment-service/cdk/lib/create-policies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ export const createPolicies = ({
const route53Policy = new PolicyStatement({
effect: Effect.ALLOW,
resources: [
// TODO: env
'arn:aws:route53:::hostedzone/Z02367201ZA0CZPSM3N2H', // is this safe to put in without env?
`arn:aws:route53:::hostedzone/${config.HOSTED_ZONE_ID}`,
],
actions: [
'route53:GetHostedZone',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CodeBuild } from 'aws-sdk'
import yaml from 'yaml'
import { PackageManagerEnum } from '../../../../foundations-ts-definitions/deployment-schema'
import { QueueNames } from '../../constants'
import { sqs, savePipelineRunnerEntity, s3Client, githubApp, getBitBucketToken } from '../../services'
import { sqs, savePipelineRunnerEntity, s3Client, githubApp, getBitBucketToken, pusher } from '../../services'
import { PipelineEntity } from '../../entities/pipeline.entity'
import fetch from 'node-fetch'
import { BitbucketClientData } from '@/entities/bitbucket-client.entity'
Expand Down Expand Up @@ -231,7 +231,11 @@ export const codebuildExecutor: SQSHandler = async (
pipeline.buildStatus = 'FAILED'
pipelineRunner.pipeline = pipeline

await Promise.all([deleteMessage(record.receiptHandle), savePipelineRunnerEntity(pipelineRunner)])
await Promise.all([
deleteMessage(record.receiptHandle),
savePipelineRunnerEntity(pipelineRunner),
pusher.trigger(`private-${pipelineRunner.pipeline?.developerId}`, 'pipeline-runner-update', pipelineRunner),
])

return Promise.reject(error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const pipelineSetup: SQSHandler = async (event: SQSEvent, context: Contex
Action: 'UPSERT',
ResourceRecordSet: {
Type: 'A',
Name: `${pipeline.subDomain}.dev.paas.reapit.cloud`,
Name: `${pipeline.subDomain}.${process.env.NODE_ENV === 'PROD' ? 'prod' : 'dev'}.paas.reapit.cloud`,
AliasTarget: {
DNSName: frontDomain,
EvaluateTargetHealth: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const tearDownR53 = (domain: string, pipelineId: string, subDomain: string): Pro
Action: 'DELETE',
ResourceRecordSet: {
Type: 'A',
Name: `${subDomain}.dev.paas.reapit.cloud`,
Name: `${subDomain}.${process.env.NODE_ENV === 'PROD' ? 'prod' : 'dev'}.paas.reapit.cloud`,
AliasTarget: {
DNSName: domain,
EvaluateTargetHealth: false,
Expand Down

0 comments on commit f16f910

Please sign in to comment.