deployable-awscdk-app-ts 0.1.680 → 0.1.681

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,188 @@
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, 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
+ /**
33
+ * Factory to create reusable steps for the deployment workflow
34
+ * @experimental
35
+ */
36
+ export declare class DeployableAwsCdkTypeScriptAppStepsFactory {
37
+ private readonly project;
38
+ private readonly props;
39
+ /**
40
+ * Create a new DeployableAwsCdkTypeScriptAppStepsFactory
41
+ * @param project The project
42
+ * @param props The factory properties
43
+ */
44
+ constructor(project: javascript.NodeProject, props: DeployableAwsCdkTypeScriptAppStepsFactoryProps);
45
+ /**
46
+ * Condition to skip a step if an active deployment is already present
47
+ * @returns JobStep condition or undefined if checkActiveDeployment is false
48
+ */
49
+ get skipIfAlreadyActiveDeploymentCondition(): JobStep | undefined;
50
+ get checkoutStep(): JobStep;
51
+ /**
52
+ * Step to run before installing dependencies if exists
53
+ * @returns JobStep or undefined if no preInstallTaskName is provided
54
+ */
55
+ get preInstallDependenciesStep(): JobStep | undefined;
56
+ /**
57
+ * Step to check if there is an active deployment for the environment in the matrix strategy
58
+ * @returns JobStep
59
+ */
60
+ get checkActiveDeploymentStepForMatrix(): JobStep | undefined;
61
+ /**
62
+ * Step to check if there is an active deployment for a specific environment
63
+ * @param environment The environment to check
64
+ * @returns JobStep
65
+ */
66
+ getCheckActiveDeploymentStepForEnvironment(environment: string): JobStep | undefined;
67
+ /**
68
+ * Step to setup AWS credentials in the environment for the matrix strategy
69
+ * @returns JobStep[]
70
+ */
71
+ get setupAwsCredentialsStepsForMatrix(): JobStep[];
72
+ /**
73
+ * Get the steps to setup AWS credentials for a specific environment
74
+ * @param environmentOptions The environment options
75
+ * @returns JobStep[]
76
+ */
77
+ getSetupAwsCredentialsStepsForEnvironment(environmentOptions: EnvironmentOptions): JobStep[];
78
+ /**
79
+ * Step to setup AWS credentials in the environment for the matrix strategy
80
+ * @returns JobStep
81
+ */
82
+ get setupAwsCredentialsInEnvironmentForMatrix(): JobStep;
83
+ /**
84
+ * Step to setup AWS credentials in the environment for a specific environment
85
+ * @param assumeRoleFlag Whether to assume a role, can be a boolean or a string for matrix strategy
86
+ * @param accessKeyIdSecretName The GitHub secret name for the access key ID
87
+ * @param secretAccessKeySecretName The GitHub secret name for the secret access key
88
+ * @param region The region
89
+ * @returns JobStep or undefined if no AWS credentials are provided,
90
+ * if assumeRoleFlag is boolean will be evaluated and return a JobStep only if false
91
+ * if assumeRoleFlag is string will always return a JobStep (for matrix strategy)
92
+ */
93
+ getSetupAwsCredentialsInEnvironmentForEnvironment(assumeRoleFlag: boolean | string, accessKeyIdSecretName: string, secretAccessKeySecretName: string, region: string): JobStep | undefined;
94
+ /**
95
+ * Step to assume an AWS role for the matrix strategy
96
+ * @returns JobStep
97
+ */
98
+ get assumeAwsRoleStepForMatrix(): JobStep;
99
+ /**
100
+ * Step to assume an AWS role for a specific environment
101
+ * @param assumeRoleFlag Whether to assume a role, can be a boolean or a string for matrix strategy
102
+ * @param accessKeyIdSecretName The GitHub secret name for the access key ID
103
+ * @param secretAccessKeySecretName The GitHub secret name for the secret access key
104
+ * @param region The region
105
+ * @param roleToAssume The role to assume
106
+ * @param assumeRoleDurationSeconds The duration for assuming the role
107
+ * @returns JobStep or undefined if assumeRoleFlag is boolean and false
108
+ * if assumeRoleFlag is string will always return a JobStep (for matrix strategy)
109
+ */
110
+ getAssumeAwsRoleStepForEnvironment(assumeRoleFlag: boolean | string, accessKeyIdSecretName: string, secretAccessKeySecretName: string, region: string, roleToAssume: string, assumeRoleDurationSeconds?: string | number): JobStep | undefined;
111
+ /**
112
+ * Step to setup NPM config if provided
113
+ * @returns JobStep or undefined if no npmConfig is provided
114
+ */
115
+ get setupNpmConfigForMatrix(): JobStep | undefined;
116
+ getSetupNpmConfigForEnvironment(environment: string): JobStep | undefined;
117
+ /**
118
+ * Get the step to run a specific script
119
+ * @param scriptName The name of the script to run
120
+ * @param stepName The name of the step in the workflow
121
+ * @param hasScriptFlag Whether the script should be run
122
+ * @returns The job step to run the script or undefined if not applicable
123
+ * If hasScriptFlag is boolean and false will return undefined
124
+ * If hasScriptFlag is string will always return a JobStep (for matrix strategy)
125
+ */
126
+ getRunScriptStep(scriptName: string, stepName: string, hasScriptFlag: boolean | string): JobStep | undefined;
127
+ /**
128
+ * Step to deploy the workflow
129
+ * @returns JobStep
130
+ */
131
+ get deploymentStep(): JobStep;
132
+ /**
133
+ * Step to run post deployment script in matrix strategy
134
+ * @returns JobStep
135
+ */
136
+ get preDeploymentStepForMatrix(): JobStep;
137
+ /**
138
+ * Get the pre-deployment step for a specific environment
139
+ * @param hasPreDeployTaskFlag Whether the pre-deployment task should be run
140
+ * @param preDeploymentScript The script to run
141
+ * @returns The job step to run the pre-deployment script or undefined if not applicable
142
+ * If hasPreDeployTaskFlag is boolean and false will return undefined
143
+ * If hasPreDeployTaskFlag is string will always return a JobStep (for matrix strategy)
144
+ */
145
+ getPreDeploymentStepForEnvironment(hasPreDeployTaskFlag: boolean | string, preDeploymentScript: string): JobStep | undefined;
146
+ /**
147
+ * Step to run post deployment script in matrix strategy
148
+ * @returns JobStep
149
+ */
150
+ get postDeploymentStepForMatrix(): JobStep;
151
+ /**
152
+ * Get the post-deployment step for a specific environment
153
+ * @param hasPostDeployTaskFlag Whether the post-deployment task should be run
154
+ * @param postDeploymentScript The script to run
155
+ * @returns The job step to run the post-deployment script or undefined if not applicable
156
+ * If hasPostDeployTaskFlag is boolean and false will return undefined
157
+ * If hasPostDeployTaskFlag is string will always return a JobStep (for matrix strategy)
158
+ */
159
+ getPostDeploymentStepForEnvironment(hasPostDeployTaskFlag: boolean | string, postDeploymentScript: string): JobStep | undefined;
160
+ /**
161
+ * Get all deployment jobs whether for matrix strategy or not
162
+ * @returns Record of jobs
163
+ */
164
+ get deploymentJobs(): Record<string, Job>;
165
+ /**
166
+ * Get deployment jobs for matrix strategy
167
+ * @returns Record of jobs
168
+ */
169
+ get deploymentJobsForMatrix(): Record<string, Job>;
170
+ /**
171
+ * Get the IDs of the jobs that must be completed before the specified environment's deployment job
172
+ * @param environmentName The name of the environment
173
+ * @returns An array of job IDs
174
+ */
175
+ getDeploymentJobPrerequisiteJobIds(environmentName: string): string[];
176
+ /**
177
+ * Get deployment jobs for multi-job strategy
178
+ * @returns Record of jobs
179
+ */
180
+ getDeploymentJobsForMultiJob(): Record<string, Job>;
181
+ /**
182
+ * Get the job definition for a specific environment
183
+ * @param environmentOptions The environment options
184
+ * @param environmentVariableName The name of the environment variable to set with the environment name, if any
185
+ * @returns The job definition for the environment
186
+ */
187
+ getJobForEnvironment(environmentOptions: EnvironmentOptions, environmentVariableName: string | undefined): Job;
188
+ }