Skip to content

Commit

Permalink
feat(client-codepipeline): CodePipeline now supports overriding sourc…
Browse files Browse the repository at this point in the history
…e revisions to achieve manual re-deploy of a past revision
  • Loading branch information
awstools committed Nov 17, 2023
1 parent 00d6cad commit 9239afa
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ export interface StartPipelineExecutionCommandOutput extends StartPipelineExecut
* },
* ],
* clientRequestToken: "STRING_VALUE",
* sourceRevisions: [ // SourceRevisionOverrideList
* { // SourceRevisionOverride
* actionName: "STRING_VALUE", // required
* revisionType: "COMMIT_ID" || "IMAGE_DIGEST" || "S3_OBJECT_VERSION_ID", // required
* revisionValue: "STRING_VALUE", // required
* },
* ],
* };
* const command = new StartPipelineExecutionCommand(input);
* const response = await client.send(command);
Expand Down
79 changes: 79 additions & 0 deletions clients/client-codepipeline/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1960,6 +1960,11 @@ export interface GitPushFilter {
* Git-based source actions that are supported by the
* <code>CodeStarSourceConnection</code> action type.</p>
* </note>
* <note>
* <p>V2 type pipelines, along with triggers on Git tags and pipeline-level variables,
* are not currently supported for CloudFormation and CDK resources in CodePipeline. For more information about V2 type pipelines, see <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html">Pipeline types</a>
* in the <i>CodePipeline User Guide</i>.</p>
* </note>
*/
export interface GitConfiguration {
/**
Expand Down Expand Up @@ -2010,6 +2015,11 @@ export type PipelineTriggerProviderType =
* <p>When a trigger configuration is specified, default change detection for
* repository and branch commits is disabled.</p>
* </note>
* <note>
* <p>V2 type pipelines, along with triggers on Git tags and pipeline-level variables,
* are not currently supported for CloudFormation and CDK resources in CodePipeline. For more information about V2 type pipelines, see <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html">Pipeline types</a>
* in the <i>CodePipeline User Guide</i>.</p>
* </note>
*/
export interface PipelineTriggerDeclaration {
/**
Expand All @@ -2030,6 +2040,11 @@ export interface PipelineTriggerDeclaration {
/**
* @public
* <p>A variable declared at the pipeline level.</p>
* <note>
* <p>V2 type pipelines, along with triggers on Git tags and pipeline-level variables,
* are not currently supported for CloudFormation and CDK resources in CodePipeline. For more information about V2 type pipelines, see <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html">Pipeline types</a>
* in the <i>CodePipeline User Guide</i>.</p>
* </note>
*/
export interface PipelineVariableDeclaration {
/**
Expand Down Expand Up @@ -2133,6 +2148,11 @@ export interface PipelineDeclaration {
* <p>For information about pricing for CodePipeline, see <a href="https://aws.amazon.com/codepipeline/pricing/">Pricing</a>.</p>
* <p>
* For information about which type of pipeline to choose, see <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html">What type of pipeline is right for me?</a>.</p>
* <note>
* <p>V2 type pipelines, along with triggers on Git tags and pipeline-level variables,
* are not currently supported for CloudFormation and CDK resources in CodePipeline. For more information about V2 type pipelines, see <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html">Pipeline types</a>
* in the <i>CodePipeline User Guide</i>.</p>
* </note>
*/
pipelineType?: PipelineType;

Expand Down Expand Up @@ -3731,6 +3751,11 @@ export interface PipelineSummary {
* <p>For information about pricing for CodePipeline, see <a href="https://aws.amazon.com/codepipeline/pricing/">Pricing</a>.</p>
* <p>
* For information about which type of pipeline to choose, see <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html">What type of pipeline is right for me?</a>.</p>
* <note>
* <p>V2 type pipelines, along with triggers on Git tags and pipeline-level variables,
* are not currently supported for CloudFormation and CDK resources in CodePipeline. For more information about V2 type pipelines, see <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html">Pipeline types</a>
* in the <i>CodePipeline User Guide</i>.</p>
* </note>
*/
pipelineType?: PipelineType;

Expand Down Expand Up @@ -4803,9 +4828,57 @@ export class StageNotRetryableException extends __BaseException {
}
}

/**
* @public
* @enum
*/
export const SourceRevisionType = {
COMMIT_ID: "COMMIT_ID",
IMAGE_DIGEST: "IMAGE_DIGEST",
S3_OBJECT_VERSION_ID: "S3_OBJECT_VERSION_ID",
} as const;

/**
* @public
*/
export type SourceRevisionType = (typeof SourceRevisionType)[keyof typeof SourceRevisionType];

/**
* @public
* <p>A list that allows you to specify, or override, the source revision for a pipeline
* execution that's being started. A source revision is the version with all the changes to
* your application code, or source artifact, for the pipeline execution.</p>
*/
export interface SourceRevisionOverride {
/**
* @public
* <p>The name of the action where the override will be applied.</p>
*/
actionName: string | undefined;

/**
* @public
* <p>The type of source revision, based on the source provider. For example, the revision
* type for the CodeCommit action provider is the commit ID.</p>
*/
revisionType: SourceRevisionType | undefined;

/**
* @public
* <p>The source revision, or version of your source artifact, with the changes that you
* want to run in the pipeline execution.</p>
*/
revisionValue: string | undefined;
}

/**
* @public
* <p>A pipeline-level variable used for a pipeline execution.</p>
* <note>
* <p>V2 type pipelines, along with triggers on Git tags and pipeline-level variables,
* are not currently supported for CloudFormation and CDK resources in CodePipeline. For more information about V2 type pipelines, see <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html">Pipeline types</a>
* in the <i>CodePipeline User Guide</i>.</p>
* </note>
*/
export interface PipelineVariable {
/**
Expand Down Expand Up @@ -4845,6 +4918,12 @@ export interface StartPipelineExecutionInput {
* request.</p>
*/
clientRequestToken?: string;

/**
* @public
* <p>A list that allows you to specify, or override, the source revision for a pipeline execution that's being started. A source revision is the version with all the changes to your application code, or source artifact, for the pipeline execution.</p>
*/
sourceRevisions?: SourceRevisionOverride[];
}

/**
Expand Down
6 changes: 6 additions & 0 deletions clients/client-codepipeline/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import {
RequestFailedException,
ResourceNotFoundException,
RetryStageExecutionInput,
SourceRevisionOverride,
StageDeclaration,
StageNotFoundException,
StageNotRetryableException,
Expand Down Expand Up @@ -3624,6 +3625,10 @@ const se_PutThirdPartyJobSuccessResultInput = (

// se_RetryStageExecutionInput omitted.

// se_SourceRevisionOverride omitted.

// se_SourceRevisionOverrideList omitted.

// se_StageActionDeclarationList omitted.

// se_StageBlockerDeclarationList omitted.
Expand All @@ -3637,6 +3642,7 @@ const se_StartPipelineExecutionInput = (input: StartPipelineExecutionInput, cont
return take(input, {
clientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
name: [],
sourceRevisions: _json,
variables: _json,
});
};
Expand Down
Loading

0 comments on commit 9239afa

Please sign in to comment.