Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Upload env version CI step fails if there is no status dashboard deployed #481

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/infra/infra-shared/src/stacks/ci/ciPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ export class CiPipeline extends Construct {
inputArtifact: sourceOutputArtifact,
});

new UploadVersionCiConfig(this, 'UploadVersionConfig', {
envSettings: props.envSettings,
stage: deployStage,
inputArtifact: sourceOutputArtifact,
});
if (props.envSettings.tools.enabled) {
new UploadVersionCiConfig(this, 'UploadVersionConfig', {
envSettings: props.envSettings,
stage: deployStage,
inputArtifact: sourceOutputArtifact,
});
}
}

private selectStage(name: string, pipeline: Pipeline) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ pnpm saas aws set-var SB_DEPLOY_BRANCHES master

### \[Optional\] Set tools env variables

The `tools` package during CI deployment is responsible for uploading the information of the version of deployed
application on specific environment. Then, you will be able to check currently deployed state in the
[version matrix](../../../working-with-sb/dev-tools/version-matrix).

To configure `tools` package env variables follow the example below.

```shell
Expand All @@ -131,6 +135,14 @@ pnpm saas aws set-var SB_TOOLS_HOSTED_ZONE_NAME example.com
pnpm saas aws set-var SB_TOOLS_DOMAIN_VERSION_MATRIX status.example.com
```

:::info

If you set `SB_TOOLS_ENABLED` to `true` make sure to deploy **version matrix** component before first CI pipeline run.

Follow the [deployment instructions](../../../working-with-sb/dev-tools/version-matrix#deployment) for more details.

:::

## Env variable validation

You can look up the validator in `packages/internal/cli/src/config/env.ts`, which runs on every `nx` command that
Expand Down
Loading