Calling Synopsys Detect from AWS CodePipeline using the AWS command-line interface

You must satisfy the following prerequisites before you complete any of the steps described:

Prerequisites:


The AWS CodeBuild project that was created and verified in Calling Synopsys Detect from AWS CodeBuild is referenced in the following steps:

  1. Create a Pipeline in AWS CodePipeline by following the procedures in http://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html#pipelines-create-cli.
    When you edit your pipeline.json file, ensure your build stage is configured to use CodeBuild and that the Project Name is configured with the name of the project that was previously created and verified by using AWS CodeBuild.

    The following example is a pipeline.json file with source and build stages that uses GitHub as the source:
    Note: Ensure that your AWS account info, region and output bucket, match your CodeBuild project information.

    {    
        "pipeline": {        
            "roleArn": "arn:aws:iam::<account id>:role/<CodePipeline service role name>",
            "stages": [
                {                
                    "name": "Source",
                    "actions": [
                        {                        
                            "inputArtifacts": [],
                            "name": "Source",
                            "actionTypeId": { 
                               "category": "Source",
                                "owner": "ThirdParty",
                                "version": "1",
                                "provider": "GitHub"
                            },                        
                            "outputArtifacts": [
                                {                                
                                    "name": "MyApp"
                                }
                            ],                        
                            "configuration": {
                                "Owner": "<GitHub username>",
                                "Repo": "<repo name>",
                                "PollForSourceChanges": "true",
                                "Branch": "master",
                                "OAuthToken": "****"                        
                            },                        
                            "runOrder": 1                    
                       }                
                    ]            
             },            
             {                
                "name": "Build",                
                "actions": [
                        {                        
                            "inputArtifacts": [
                                {
                                    "name": "MyApp"
                                }
                            ],
                            "name": "CodeBuild",
                            "actionTypeId": {
                                "category": "Build",
                                "owner": "AWS",
                                "version": "1",
                                "provider": "CodeBuild"                        
                            },                        
                            "outputArtifacts": [
                                {
                                    "name": "target"
                                }
                            ],
                            "configuration": {
                                "ProjectName": "<project name>"
                            },
                            "runOrder": 1
                        }
                    ]
                }
            ],        
            "artifactStore": {
                "type": "S3",
                "location": "<output bucket name>"
            },
            "name": "<pipeline name>",
            "version": 1
        }
    }
  2. After a new pipeline is created, a pipeline job starts automatically.
    Following a successful build, you can download and view the artifacts from S3.
    The artifacts are pushed to S3 by using archive (.zip) files. The artifact contains the built artifact and a PDF of the risk profile report.
  3. The scan results are pushed to Black Duck.
  4. View the console logs and check the pipeline job status.
    1. The console logs for CodeBuild are at https://console.aws.amazon.com under Services > Management Tools > CloudWatch > Logs.
      Select the corresponding CodeBuild project and view the latest log.
    2. Check the status of the pipeline job by navigating to the corresponding pipeline in https://console.aws.amazon.com/codepipeline, and click View pipeline history.

If there are changes in the source code, the AWS CodePipeline runs those changes through the pipeline and starts a new pipeline job.
The AWS CodeBuild project is invoked during the build stage.


.
















©2020 Synopsys, Inc. All Rights Reserved