Start a pipeline with a source revision override - Amazon CodePipeline
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Start a pipeline with a source revision override

You can use overrides to start a pipeline with a specific source revision ID that you provide for the pipeline execution. For example, if you want to start a pipeline that will process a specific commit ID from your CodeCommit source, you can add the commit ID as an override when you start your pipeline.

There are three types of source revision for revisionType:

  • COMMIT_ID

  • IMAGE_DIGEST

  • S3_OBJECT_VERSION_ID

Note

For the COMMIT_ID and IMAGE_DIGEST types of source revisions, the source revision ID applies to all content in the repository, across all branches.

Start a pipeline with a source revision override (console)

To manually start a pipeline and run the most recent revision through a pipeline
  1. Sign in to the Amazon Web Services Management Console and open the CodePipeline console at http://console.www.amazonaws.cn/codesuite/codepipeline/home.

  2. In Name, choose the name of the pipeline you want to start.

  3. On the pipeline details page, choose Release change. Choosing Release change opens the Release change window. For Source revision override, choose the arrow to expand the field. In Source, enter the source revision ID. For example, if your pipeline has a CodeCommit source, choose the commit ID from the field that you want to use.

    
                            An example of the overrides screen in CodePipeline.

Start a pipeline with a source revision override (CLI)

To manually start a pipeline and run the specified source revision ID for an artifact through a pipeline
  1. Open a terminal (Linux, OS X, or Unix) or command prompt (Windows) and use the Amazon CLI to run the start-pipeline-execution command, specifying the name of the pipeline you want to start. You also use the --source-revisions argument to provide the source revision ID. The source revision is made up of the actionName, revisionType, and revisionValue. Valid revisionType values are COMMIT_ID | IMAGE_DIGEST | S3_OBJECT_VERSION_ID.

    In the following example, to start running the specified change through a pipeline named codecommit-pipeline, the following command species a source action name of Source, a revision type of COMMIT_ID, and a commit ID of 78a25c18755ccac3f2a9eec099dEXAMPLE.

    aws codepipeline start-pipeline-execution --name codecommit-pipeline --source-revisions actionName=Source,revisionType=COMMIT_ID,revisionValue=78a25c18755ccac3f2a9eec099dEXAMPLE --region us-west-1
  2. To verify success, view the returned object. This command returns an execution ID, similar to the following:

    { "pipelineExecutionId": "c53dbd42-This-Is-An-Example" }
    Note

    After you have started the pipeline, you can monitor its progress in the CodePipeline console or by running the get-pipeline-state command. For more information, see View pipelines (console) and View pipeline details and history (CLI).