CI/CD - CodeBuild + CodeDeploy + CodePipeline
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
export interface CodeBuildEnvironmentVariableOverride {
|
||||
name: string
|
||||
value: string
|
||||
type?: 'PLAINTEXT' | 'PARAMETER_STORE' | 'SECRETS_MANAGER'
|
||||
}
|
||||
|
||||
export interface StartCodeBuildInput {
|
||||
environmentVariablesOverride?: CodeBuildEnvironmentVariableOverride[]
|
||||
}
|
||||
|
||||
export interface CodeBuildPhase {
|
||||
phaseType: string
|
||||
phaseStatus?: string
|
||||
startTime?: Date
|
||||
endTime?: Date
|
||||
contexts: Array<{statusCode?: string; message?: string}>
|
||||
}
|
||||
|
||||
export interface CodeBuildBuild {
|
||||
id: string
|
||||
arn?: string
|
||||
projectName: string
|
||||
buildNumber?: number
|
||||
buildStatus?: string
|
||||
currentPhase?: string
|
||||
startTime?: Date
|
||||
endTime?: Date
|
||||
phases: CodeBuildPhase[]
|
||||
logGroupName?: string
|
||||
logStreamName?: string
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import type {FieldSchema, ServiceSchema, TableColumnSchema} from './types'
|
||||
|
||||
const projectColumns: TableColumnSchema[] = [
|
||||
{name: 'name', label: 'Name'},
|
||||
{name: 'environmentType', label: 'Environment', path: 'metadata.environmentType', format: 'badge'},
|
||||
{name: 'computeType', label: 'Compute', path: 'metadata.computeType', format: 'badge'},
|
||||
{name: 'createdAt', label: 'Created', format: 'datetime'},
|
||||
]
|
||||
|
||||
const projectFilters: FieldSchema[] = [{name: 'search', label: 'Search', type: 'text', required: false}]
|
||||
|
||||
/** The console exposes only source and artifact modes the local runtime can execute. */
|
||||
export function awsCodeBuildSchema(): ServiceSchema {
|
||||
return {
|
||||
cloud: 'aws',
|
||||
service: 'codebuild',
|
||||
displayName: 'AWS CodeBuild',
|
||||
fields: [
|
||||
{name: 'name', label: 'Project name', type: 'text', required: true, group: 'Required'},
|
||||
{name: 'serviceRole', label: 'Service role ARN', type: 'text', required: true, group: 'Required'},
|
||||
{
|
||||
name: 'environmentImage', label: 'Environment image', type: 'text', required: false, group: 'Environment',
|
||||
defaultValue: 'aws/codebuild/standard:7.0',
|
||||
description: 'AWS CodeBuild managed image identifier.',
|
||||
},
|
||||
{
|
||||
name: 'computeType', label: 'Compute type', type: 'select', required: true, group: 'Environment', defaultValue: 'BUILD_GENERAL1_SMALL',
|
||||
options: [{label: 'General 1 small', value: 'BUILD_GENERAL1_SMALL'}],
|
||||
},
|
||||
],
|
||||
actions: ['list', 'create', 'delete', 'inspect'],
|
||||
capabilities: {
|
||||
resourceActions: [
|
||||
{name: 'list', label: 'List projects', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'inspect', label: 'Inspect project', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'create', label: 'Create project', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'delete', label: 'Delete project', enabled: true, status: 'available', runtimeRequired: true},
|
||||
],
|
||||
},
|
||||
filters: projectFilters,
|
||||
columns: projectColumns,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
export interface CodeDeployDeployment {
|
||||
id: string
|
||||
applicationName: string
|
||||
deploymentGroupName: string
|
||||
status: string | null
|
||||
creator: string | null
|
||||
deploymentConfigName: string | null
|
||||
createTime: Date | undefined
|
||||
completeTime: Date | undefined
|
||||
errorInformation: {code?: string; message?: string} | null
|
||||
targetVersion: string | null
|
||||
currentVersion: string | null
|
||||
trafficPercent: number | null
|
||||
}
|
||||
|
||||
export interface StartCodeDeployDeploymentInput {
|
||||
functionName: string
|
||||
alias: string
|
||||
currentVersion: string
|
||||
targetVersion: string
|
||||
beforeAllowTrafficHook?: string
|
||||
afterAllowTrafficHook?: string
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import type {FieldSchema, ServiceSchema, TableColumnSchema} from './types'
|
||||
|
||||
const columns: TableColumnSchema[] = [
|
||||
{name: 'name', label: 'Deployment group'},
|
||||
{name: 'applicationName', label: 'Application', path: 'metadata.applicationName'},
|
||||
{name: 'deploymentConfigName', label: 'Configuration', path: 'metadata.deploymentConfigName', format: 'badge'},
|
||||
{name: 'updatedAt', label: 'Updated', path: 'metadata.updatedAt', format: 'datetime'},
|
||||
]
|
||||
|
||||
const filters: FieldSchema[] = [{name: 'search', label: 'Search', type: 'text', required: false}]
|
||||
|
||||
export function awsCodeDeploySchema(): ServiceSchema {
|
||||
return {
|
||||
cloud: 'aws', service: 'codedeploy', displayName: 'AWS CodeDeploy', fields: [], actions: ['list', 'create', 'delete', 'inspect'],
|
||||
capabilities: {resourceActions: [
|
||||
{name: 'list', label: 'List deployment groups', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'inspect', label: 'Inspect deployment group', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'create', label: 'Create application and group', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'delete', label: 'Delete deployment group', enabled: true, status: 'available', runtimeRequired: true},
|
||||
]},
|
||||
filters, columns,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
export interface PipelineExecutionSummary {
|
||||
id: string
|
||||
status?: string
|
||||
statusSummary?: string
|
||||
startTime?: Date
|
||||
lastUpdateTime?: Date
|
||||
}
|
||||
|
||||
export interface PipelineActionState {
|
||||
name: string
|
||||
status?: string
|
||||
summary?: string
|
||||
lastStatusChange?: Date
|
||||
externalExecutionId?: string
|
||||
externalExecutionUrl?: string
|
||||
entityUrl?: string
|
||||
revisionUrl?: string
|
||||
codeBuildProject?: string
|
||||
codeDeployDeploymentId?: string
|
||||
}
|
||||
|
||||
export interface PipelineStageState {
|
||||
name: string
|
||||
status?: string
|
||||
lastStatusChange?: Date
|
||||
actions: PipelineActionState[]
|
||||
}
|
||||
|
||||
export interface PipelineState {
|
||||
stages: PipelineStageState[]
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import type {FieldSchema, ServiceSchema, TableColumnSchema} from './types'
|
||||
|
||||
const columns: TableColumnSchema[] = [
|
||||
{name: 'name', label: 'Name'},
|
||||
{name: 'executionMode', label: 'Execution mode', path: 'metadata.executionMode', format: 'badge'},
|
||||
{name: 'version', label: 'Version', format: 'code'},
|
||||
{name: 'updatedAt', label: 'Updated', path: 'metadata.updatedAt', format: 'datetime'},
|
||||
]
|
||||
|
||||
const filters: FieldSchema[] = [{name: 'search', label: 'Search', type: 'text', required: false}]
|
||||
|
||||
export function awsCodePipelineSchema(): ServiceSchema {
|
||||
return {
|
||||
cloud: 'aws', service: 'codepipeline', displayName: 'AWS CodePipeline', fields: [
|
||||
{name: 'name', label: 'Pipeline name', type: 'text', required: true, group: 'Pipeline'},
|
||||
{name: 'roleArn', label: 'Service role ARN', type: 'text', required: true, group: 'Pipeline'},
|
||||
{name: 'artifactBucket', label: 'Artifact S3 bucket', type: 'text', required: true, group: 'Artifacts'},
|
||||
{name: 'sourceBucket', label: 'Source S3 bucket', type: 'text', required: true, group: 'Source'},
|
||||
{name: 'sourceKey', label: 'Source object key', type: 'text', required: true, group: 'Source'},
|
||||
{name: 'codeBuildProject', label: 'CodeBuild project', type: 'text', required: true, group: 'Build'},
|
||||
{name: 'deployBucket', label: 'Deploy S3 bucket', type: 'text', required: true, group: 'Deploy'},
|
||||
{name: 'deployKey', label: 'Deploy object key', type: 'text', required: true, group: 'Deploy'},
|
||||
],
|
||||
actions: ['list', 'create', 'delete', 'inspect'],
|
||||
capabilities: {resourceActions: [
|
||||
{name: 'list', label: 'List pipelines', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'inspect', label: 'Inspect pipeline', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'create', label: 'Create pipeline', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'delete', label: 'Delete pipeline', enabled: true, status: 'available', runtimeRequired: true},
|
||||
]},
|
||||
filters, columns,
|
||||
}
|
||||
}
|
||||
@@ -114,6 +114,9 @@ export function awsDatabaseSchema(): ServiceSchema {
|
||||
{name: 'update', label: 'Update DB instance', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'delete', label: 'Delete DB instance', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'inspect', label: 'Inspect DB instance', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'start', label: 'Start DB instance', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'stop', label: 'Stop DB instance', enabled: true, status: 'available', runtimeRequired: true},
|
||||
{name: 'reboot', label: 'Reboot DB instance', enabled: true, status: 'available', runtimeRequired: true},
|
||||
],
|
||||
databaseActions: [
|
||||
{
|
||||
|
||||
@@ -77,6 +77,24 @@ export const SERVICE_CATALOG = {
|
||||
group: 'Compute',
|
||||
order: 40,
|
||||
},
|
||||
codebuild: {
|
||||
displayName: 'CodeBuild',
|
||||
iconKey: 'codebuild',
|
||||
group: 'Compute',
|
||||
order: 50,
|
||||
},
|
||||
codepipeline: {
|
||||
displayName: 'CodePipeline',
|
||||
iconKey: 'codepipeline',
|
||||
group: 'Integration',
|
||||
order: 25,
|
||||
},
|
||||
codedeploy: {
|
||||
displayName: 'CodeDeploy',
|
||||
iconKey: 'codedeploy',
|
||||
group: 'Integration',
|
||||
order: 26,
|
||||
},
|
||||
storage: {displayName: 'Storage', iconKey: 'storage', group: 'Storage', order: 10},
|
||||
ecr: {
|
||||
displayName: 'Elastic Container Registry',
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// Derived from SERVICE_CATALOG so a new catalog row is a new service type.
|
||||
// This type-only cycle with serviceCatalog.ts is erased at compile time.
|
||||
import type {CloudServiceType, ServiceGroup} from './serviceCatalog'
|
||||
import type {CodeBuildBuild, StartCodeBuildInput} from './codebuild'
|
||||
import type {PipelineExecutionSummary, PipelineState} from './codepipeline'
|
||||
import type {CodeDeployDeployment, StartCodeDeployDeploymentInput} from './codedeploy'
|
||||
import type {
|
||||
ChildItem,
|
||||
CollectionActionName,
|
||||
@@ -103,6 +106,7 @@ export interface FieldSchema {
|
||||
* that a capability block can describe but that are not table-level controls.
|
||||
*/
|
||||
export type ActionSchema = 'list' | 'create' | 'update' | 'delete' | 'inspect'
|
||||
export type ResourceLifecycleAction = 'start' | 'stop' | 'reboot'
|
||||
export type ResourceActionName =
|
||||
| 'list'
|
||||
| 'create'
|
||||
@@ -112,9 +116,7 @@ export type ResourceActionName =
|
||||
| 'encrypt'
|
||||
| 'decrypt'
|
||||
| 'invoke'
|
||||
| 'start'
|
||||
| 'stop'
|
||||
| 'reboot'
|
||||
| ResourceLifecycleAction
|
||||
| 'updateTags'
|
||||
export type ObjectActionName = 'list' | 'upload' | 'download' | 'delete' | 'createFolder' | 'copy'
|
||||
export type DatabaseActionName = 'listSnapshots' | 'createSnapshot'
|
||||
@@ -266,7 +268,7 @@ export interface SqlConnectionInput {
|
||||
username: string
|
||||
password: string
|
||||
database?: string
|
||||
engine?: 'azure-sql' | 'postgresql'
|
||||
engine?: 'azure-sql' | 'postgresql' | 'mysql'
|
||||
}
|
||||
|
||||
export interface SqlDatabase {
|
||||
@@ -854,4 +856,14 @@ export interface CloudServiceAdapter {
|
||||
deleteAppConfigDeploymentStrategy?(strategyId: string): Promise<void>
|
||||
startAppConfigDeployment?(applicationId: string, environmentId: string, input: CreateResourceInput): Promise<AppConfigDeployment>
|
||||
getAppConfigDeployment?(applicationId: string, environmentId: string, deploymentNumber: number): Promise<AppConfigDeployment | null>
|
||||
startBuild?(projectName: string, input: StartCodeBuildInput): Promise<CodeBuildBuild>
|
||||
listBuilds?(projectName: string): Promise<CodeBuildBuild[]>
|
||||
getBuild?(id: string): Promise<CodeBuildBuild | null>
|
||||
startPipeline?(id: string): Promise<{id: string}>
|
||||
listPipelineExecutions?(id: string): Promise<PipelineExecutionSummary[]>
|
||||
getPipelineState?(id: string): Promise<PipelineState>
|
||||
startCodeDeployDeployment?(applicationName: string, deploymentGroupName: string, input: StartCodeDeployDeploymentInput): Promise<CodeDeployDeployment>
|
||||
listCodeDeployDeployments?(applicationName: string, deploymentGroupName: string): Promise<CodeDeployDeployment[]>
|
||||
getCodeDeployDeployment?(id: string): Promise<CodeDeployDeployment>
|
||||
stopCodeDeployDeployment?(id: string, rollback: boolean): Promise<void>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user