Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
fix(firmware-ci): detect CD setting correctlyn
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Nov 13, 2020
1 parent e915d4e commit c5640ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions cdk/stacks/ContinuousDeployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ export class ContinuousDeploymentStack extends CloudFormation.Stack {
'Whether the continuous deployment of the Device UI is enabled or disabled.',
})

// CD for the Device UI is implied by enabled CD (in that case this Stack exists) and enabled Device UI
const enabledFirmwareCiCD = checkFlag({
key: 'firmware-ci',
component: 'Firmware CI Continuous Deployment',
onUndefined: 'disabled',
})
new CloudFormation.CfnOutput(this, 'firmwareCiCD', {
value: enabledFirmwareCiCD ? 'enabled' : 'disabled',
exportName: `${this.stackName}:firmwareCiCD`,
description:
'Whether the continuous deployment of the Firmware CI is enabled or disabled.',
})

const { bifravstAWS, deviceUI, webApp } = properties

const codeBuildRole = new IAM.Role(this, 'CodeBuildRole', {
Expand Down Expand Up @@ -134,6 +147,10 @@ export class ContinuousDeploymentStack extends CloudFormation.Stack {
name: 'DEVICEUI',
value: enableDeviceUICD ? '1' : '0',
},
{
name: 'FIRMWARECI',
value: enabledFirmwareCiCD ? '1' : '0',
},
],
},
})
Expand Down
2 changes: 1 addition & 1 deletion continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ phases:
build:
commands:
- npx cdk deploy --trace -v --require-approval never '*' -c webapp=$WEBAPP
-c deviceui=$DEVICEUI
-c deviceui=$DEVICEUI -c firmware-ci=$FIRMWARECI

0 comments on commit c5640ce

Please sign in to comment.