Skip to content

Commit

Permalink
chore(infra): Refactor for clarity on where default is set [experiment]
Browse files Browse the repository at this point in the history
  • Loading branch information
Justinon committed Sep 11, 2023
1 parent 213d19b commit 5d9b3d3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/workflows/ecs-service-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import { clickupEcsService } from '../clickup-ecs-service';
import { OptionalNodeVersion } from '../optional-node-version';

export module ecsServiceBuildPublishWorkflow {
export enum ClickUpSupportedArchType {
ARM64 = 'arm64',
AMD64 = 'amd64',
}

const DEFAULT_RETRY_ACTION = 'nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd'; // v2.8.3
export const WORKFLOW_LOCATION = '.github/workflows/ecs-service-build-publish.yml';
const DEFAULT_BUILD_ARCHITECTURES = [ClickUpSupportedArchType.ARM64];

function createBuildPublishWorkflow(options: BuildPublishOptionsConfig) {
const nodeVersion = options.nodeVersion ?? '16';
Expand Down Expand Up @@ -73,11 +79,6 @@ export module ecsServiceBuildPublishWorkflow {
return defaultWorkflow;
}

export enum ClickUpSupportedArchType {
ARM64 = 'arm64',
AMD64 = 'amd64',
}

export interface BuildPublishOptionsConfig extends OptionalNodeVersion {
/**
* List of build architectures for which to build Docker artifacts.
Expand All @@ -92,7 +93,7 @@ export module ecsServiceBuildPublishWorkflow {
) {
let jobs: Record<string, any> = {};
const supportedArchTypes = Object.values(ClickUpSupportedArchType);
const buildArchitectures = options.buildArchitectures ?? [ClickUpSupportedArchType.ARM64];
const buildArchitectures = options.buildArchitectures ?? DEFAULT_BUILD_ARCHITECTURES;

if (buildArchitectures.length === 0) {
throw new Error(
Expand Down

0 comments on commit 5d9b3d3

Please sign in to comment.