deployable-awscdk-app-ts 0.1.680 → 0.1.682

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/steps.d.ts CHANGED
@@ -1,13 +1,198 @@
1
1
  import { javascript } from 'projen';
2
- import { JobStep } from 'projen/lib/github/workflows-model';
2
+ import { JobStep, Job } from 'projen/lib/github/workflows-model';
3
3
  import { CodeArtifactAuthProvider } from 'projen/lib/javascript';
4
- export declare function checkoutStep(): JobStep;
5
- export declare function setNodeVersionStep(nodeVersion: string, checkActiveDeployment: boolean): JobStep;
6
- export declare function installDependenciesStep(command: string, checkActiveDeployment: boolean): JobStep;
7
- export declare function deploymentStep(checkActiveDeployment: boolean, packageManager: javascript.NodePackageManager): JobStep;
8
- export declare function setAwsCredentialsSteps(checkActiveDeployment: boolean, authProvider?: CodeArtifactAuthProvider): JobStep[];
9
- export declare function setNpmConfig(configName: string, configValue: string, checkActiveDeployment: boolean): JobStep;
10
- export declare function checkActiveDeploymentStep(): JobStep;
11
- export declare function postDeploymentStep(checkActiveDeployment: boolean, packageManager: javascript.NodePackageManager): JobStep;
12
- export declare function preDeploymentStep(checkActiveDeployment: boolean, packageManager: javascript.NodePackageManager): JobStep;
13
- export declare function preInstallDependenciesStep(taskName: string, checkActiveDeployment: boolean): JobStep;
4
+ import { DeployJobStrategy, DeployOptions, EnvironmentDeploymentDependencies, EnvironmentOptions } from './types';
5
+ export interface DeployableAwsCdkTypeScriptAppStepsFactoryProps {
6
+ /**
7
+ * Deployment options
8
+ */
9
+ readonly deployOptions: DeployOptions;
10
+ /**
11
+ * Whether to check for active deployments before proceeding with deployment
12
+ */
13
+ readonly checkActiveDeployment: boolean;
14
+ /**
15
+ * The name of the task to run before installing dependencies, if any
16
+ */
17
+ readonly preInstallTaskName?: string;
18
+ /**
19
+ * The authentication provider for CodeArtifact, if any
20
+ */
21
+ readonly authProvider?: CodeArtifactAuthProvider;
22
+ /**
23
+ * The npm config to set with the environment that is being deployed, if any
24
+ * Note: This is not supported for node versions above 18
25
+ */
26
+ readonly npmConfigEnvironment?: string;
27
+ /**
28
+ * Deployment job strategy, whether to use a matrix job or multiple jobs for each environment
29
+ */
30
+ readonly jobStrategy: DeployJobStrategy;
31
+ /**
32
+ * Environment deployment dependencies, if any
33
+ */
34
+ readonly environmentDependencies?: EnvironmentDeploymentDependencies;
35
+ }
36
+ /**
37
+ * Factory to create reusable steps for the deployment workflow
38
+ * @experimental
39
+ */
40
+ export declare class DeployableAwsCdkTypeScriptAppStepsFactory {
41
+ private readonly project;
42
+ private readonly props;
43
+ /**
44
+ * Validate that the provided environment deployment dependencies are valid
45
+ * @param deployOptions The deployment options
46
+ * @param environmentDependencies The environment deployment dependencies to validate
47
+ */
48
+ static validateEnvironmentDeploymentDependencies(deployOptions: DeployOptions, environmentDependencies: EnvironmentDeploymentDependencies): void;
49
+ /**
50
+ * Create a new DeployableAwsCdkTypeScriptAppStepsFactory
51
+ * @param project The project
52
+ * @param props The factory properties
53
+ */
54
+ constructor(project: javascript.NodeProject, props: DeployableAwsCdkTypeScriptAppStepsFactoryProps);
55
+ /**
56
+ * Condition to skip a step if an active deployment is already present
57
+ * @returns JobStep condition or undefined if checkActiveDeployment is false
58
+ */
59
+ get skipIfAlreadyActiveDeploymentCondition(): JobStep | undefined;
60
+ get checkoutStep(): JobStep;
61
+ /**
62
+ * Step to run before installing dependencies if exists
63
+ * @returns JobStep or undefined if no preInstallTaskName is provided
64
+ */
65
+ get preInstallDependenciesStep(): JobStep | undefined;
66
+ /**
67
+ * Step to check if there is an active deployment for the environment in the matrix strategy
68
+ * @returns JobStep
69
+ */
70
+ get checkActiveDeploymentStepForMatrix(): JobStep | undefined;
71
+ /**
72
+ * Step to check if there is an active deployment for a specific environment
73
+ * @param environment The environment to check
74
+ * @returns JobStep
75
+ */
76
+ getCheckActiveDeploymentStepForEnvironment(environment: string): JobStep | undefined;
77
+ /**
78
+ * Step to setup AWS credentials in the environment for the matrix strategy
79
+ * @returns JobStep[]
80
+ */
81
+ get setupAwsCredentialsStepsForMatrix(): JobStep[];
82
+ /**
83
+ * Get the steps to setup AWS credentials for a specific environment
84
+ * @param environmentOptions The environment options
85
+ * @returns JobStep[]
86
+ */
87
+ getSetupAwsCredentialsStepsForEnvironment(environmentOptions: EnvironmentOptions): JobStep[];
88
+ /**
89
+ * Step to setup AWS credentials in the environment for the matrix strategy
90
+ * @returns JobStep
91
+ */
92
+ get setupAwsCredentialsInEnvironmentForMatrix(): JobStep;
93
+ /**
94
+ * Step to setup AWS credentials in the environment for a specific environment
95
+ * @param assumeRoleFlag Whether to assume a role, can be a boolean or a string for matrix strategy
96
+ * @param accessKeyIdSecretName The GitHub secret name for the access key ID
97
+ * @param secretAccessKeySecretName The GitHub secret name for the secret access key
98
+ * @param region The region
99
+ * @returns JobStep or undefined if no AWS credentials are provided,
100
+ * if assumeRoleFlag is boolean will be evaluated and return a JobStep only if false
101
+ * if assumeRoleFlag is string will always return a JobStep (for matrix strategy)
102
+ */
103
+ getSetupAwsCredentialsInEnvironmentForEnvironment(assumeRoleFlag: boolean | string, accessKeyIdSecretName: string, secretAccessKeySecretName: string, region: string): JobStep | undefined;
104
+ /**
105
+ * Step to assume an AWS role for the matrix strategy
106
+ * @returns JobStep
107
+ */
108
+ get assumeAwsRoleStepForMatrix(): JobStep;
109
+ /**
110
+ * Step to assume an AWS role for a specific environment
111
+ * @param assumeRoleFlag Whether to assume a role, can be a boolean or a string for matrix strategy
112
+ * @param accessKeyIdSecretName The GitHub secret name for the access key ID
113
+ * @param secretAccessKeySecretName The GitHub secret name for the secret access key
114
+ * @param region The region
115
+ * @param roleToAssume The role to assume
116
+ * @param assumeRoleDurationSeconds The duration for assuming the role
117
+ * @returns JobStep or undefined if assumeRoleFlag is boolean and false
118
+ * if assumeRoleFlag is string will always return a JobStep (for matrix strategy)
119
+ */
120
+ getAssumeAwsRoleStepForEnvironment(assumeRoleFlag: boolean | string, accessKeyIdSecretName: string, secretAccessKeySecretName: string, region: string, roleToAssume: string, assumeRoleDurationSeconds?: string | number): JobStep | undefined;
121
+ /**
122
+ * Step to setup NPM config if provided
123
+ * @returns JobStep or undefined if no npmConfig is provided
124
+ */
125
+ get setupNpmConfigForMatrix(): JobStep | undefined;
126
+ getSetupNpmConfigForEnvironment(environment: string): JobStep | undefined;
127
+ /**
128
+ * Get the step to run a specific script
129
+ * @param scriptName The name of the script to run
130
+ * @param stepName The name of the step in the workflow
131
+ * @param hasScriptFlag Whether the script should be run
132
+ * @returns The job step to run the script or undefined if not applicable
133
+ * If hasScriptFlag is boolean and false will return undefined
134
+ * If hasScriptFlag is string will always return a JobStep (for matrix strategy)
135
+ */
136
+ getRunScriptStep(scriptName: string, stepName: string, hasScriptFlag: boolean | string): JobStep | undefined;
137
+ /**
138
+ * Step to deploy the workflow
139
+ * @returns JobStep
140
+ */
141
+ get deploymentStep(): JobStep;
142
+ /**
143
+ * Step to run post deployment script in matrix strategy
144
+ * @returns JobStep
145
+ */
146
+ get preDeploymentStepForMatrix(): JobStep;
147
+ /**
148
+ * Get the pre-deployment step for a specific environment
149
+ * @param hasPreDeployTaskFlag Whether the pre-deployment task should be run
150
+ * @param preDeploymentScript The script to run
151
+ * @returns The job step to run the pre-deployment script or undefined if not applicable
152
+ * If hasPreDeployTaskFlag is boolean and false will return undefined
153
+ * If hasPreDeployTaskFlag is string will always return a JobStep (for matrix strategy)
154
+ */
155
+ getPreDeploymentStepForEnvironment(hasPreDeployTaskFlag: boolean | string, preDeploymentScript: string): JobStep | undefined;
156
+ /**
157
+ * Step to run post deployment script in matrix strategy
158
+ * @returns JobStep
159
+ */
160
+ get postDeploymentStepForMatrix(): JobStep;
161
+ /**
162
+ * Get the post-deployment step for a specific environment
163
+ * @param hasPostDeployTaskFlag Whether the post-deployment task should be run
164
+ * @param postDeploymentScript The script to run
165
+ * @returns The job step to run the post-deployment script or undefined if not applicable
166
+ * If hasPostDeployTaskFlag is boolean and false will return undefined
167
+ * If hasPostDeployTaskFlag is string will always return a JobStep (for matrix strategy)
168
+ */
169
+ getPostDeploymentStepForEnvironment(hasPostDeployTaskFlag: boolean | string, postDeploymentScript: string): JobStep | undefined;
170
+ /**
171
+ * Get all deployment jobs whether for matrix strategy or not
172
+ * @returns Record of jobs
173
+ */
174
+ get deploymentJobs(): Record<string, Job>;
175
+ /**
176
+ * Get deployment jobs for matrix strategy
177
+ * @returns Record of jobs
178
+ */
179
+ get deploymentJobsForMatrix(): Record<string, Job>;
180
+ /**
181
+ * Get the IDs of the jobs that must be completed before the specified environment's deployment job
182
+ * @param environmentName The name of the environment
183
+ * @returns An array of job IDs
184
+ */
185
+ getDeploymentJobPrerequisiteJobIds(environmentName: string): string[];
186
+ /**
187
+ * Get deployment jobs for multi-job strategy
188
+ * @returns Record of jobs
189
+ */
190
+ getDeploymentJobsForMultiJob(): Record<string, Job>;
191
+ /**
192
+ * Get the job definition for a specific environment
193
+ * @param environmentOptions The environment options
194
+ * @param environmentVariableName The name of the environment variable to set with the environment name, if any
195
+ * @returns The job definition for the environment
196
+ */
197
+ getJobForEnvironment(environmentOptions: EnvironmentOptions, environmentVariableName: string | undefined): Job;
198
+ }