This repository was archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcodebuildTypes.ts
121 lines (114 loc) · 2.81 KB
/
codebuildTypes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/**
* See https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html#sample-build-notifications-ref
*/
export type CodeBuildPhase =
| 'SUBMITTED'
| 'PROVISIONING'
| 'DOWNLOAD_SOURCE'
| 'INSTALL'
| 'PRE_BUILD'
| 'BUILD'
| 'POST_BUILD'
| 'UPLOAD_ARTIFACTS'
| 'FINALIZING'
| 'COMPLETED';
export type CodeBuildStatus =
| 'IN_PROGRESS'
| 'SUCCEEDED'
| 'TIMED_OUT'
| 'STOPPED'
| 'FAILED'
| 'SUCCEEDED'
| 'FAULT'
| 'CLIENT_ERROR';
interface CodeBuildEnvironmentVariable {
name: string;
value: string;
type: 'PLAINTEXT' | 'SSM';
}
interface CodeBuildPhaseInformation {
'phase-context'?: string[];
'start-time': string;
'end-time'?: string;
'duration-in-seconds'?: number;
'phase-type': CodeBuildPhase;
'phase-status'?: CodeBuildStatus;
}
interface CodeBuildEventAdditionalInformation {
artifact?: {
md5sum?: string;
sha256sum?: string;
location: string;
};
environment: {
image: string;
'privileged-mode': boolean;
'compute-type':
| 'BUILD_GENERAL1_SMALL'
| 'BUILD_GENERAL1_MEDIUM'
| 'BUILD_GENERAL1_LARGE';
type: 'LINUX_CONTAINER';
'environment-variables': CodeBuildEnvironmentVariable[];
};
'timeout-in-minutes': number;
'build-complete': boolean;
initiator: string;
'build-start-time': string;
source: {
buildspec?: string;
auth?: {
type: string; // can be 'OAUTH' and possibly other values
};
location: string;
type: 'S3' | 'GITHUB';
};
'source-version'?: string;
logs?: {
'group-name': string;
'stream-name': string;
'deep-link': string;
};
phases?: CodeBuildPhaseInformation[];
}
export interface CodeBuildStateEvent {
version: string;
id: string;
'detail-type': 'CodeBuild Build State Change';
source: 'aws.codebuild';
account: string;
time: string;
region: string;
resources: string[];
detail: {
'build-status': CodeBuildStatus;
'project-name': string;
'build-id': string;
'additional-information': CodeBuildEventAdditionalInformation;
'current-phase': CodeBuildPhase;
'current-phase-context': string;
version: string;
};
}
export interface CodeBuildPhaseEvent {
version: string;
id: string;
'detail-type': 'CodeBuild Build Phase Change';
source: 'aws.codebuild';
account: string;
time: string;
region: string;
resources: string[];
detail: {
'completed-phase': CodeBuildPhase;
'project-name': string;
'build-id': string;
'completed-phase-context': string;
'completed-phase-status': CodeBuildStatus;
'completed-phase-duration-seconds': number;
version: string;
'completed-phase-start': string;
'completed-phase-end': string;
'additional-information': CodeBuildEventAdditionalInformation;
};
}
export type CodeBuildEvent = CodeBuildStateEvent | CodeBuildPhaseEvent;