Update Endpoint

Description

Updates an existing CodePipeline

Process Flowchart

Expected Payload

{
  "input": {
    "pipeline": {
      "label": ""
    },
    "repo": {
      "type": "",
      "name": "",
      "branch": "",
      "owner": "",
      "oauthtoken": ""
    },
    "variables": {
      "pos_user": "",
      "pos_token": "",
      "pos_url": ""
    }
  },
  "output": {
    "webhook": "",
    "s3": ""
  },
  "processing": [
    {
      "label": "",
      "container": ""
    }
  ]
}

Perform POST method with the following payload

Expected Response

{
    "statusCode": 200,
    "body": "\"Codepipeline: <pipeline-name> update has started\""
}

Label

  • Name of the CodePipeline to be updated. Must be unique.
  • This will be concatenated to the string name “ins-pipeline”. For example if you entered label as “INS-LRN”, the pipeline to be updated will be named “ins-pipeline-INS-LRN”
  • Only alphanumeric characters are allowed

Repo

  • Source / Repository where the code changes will be coming from
  • Must be on the same region with CodePipeline

Type

  • Either CodeCommit or GitHub is supported as the repository type

Name

  • Name of Repository

Branch

  • Branch of the repository

Owner

  • (Optional) Owner of the GitHub repository and only required when using a GitHub as a source

Oauthtoken

  • (Optional) Personal Access Token generated on the GitHub account that will grant CodePipeline access to the repository.
  • This will only be required when using GitHub as a source

Variables

  • Environment variables that would be set on all CodeBuilds and can be accessed by the process scripts.
  • This can be set to empty if there are no variables needed

Webhook

  • (Optional) Slack Webhook for a channel that will be used to notify on what command is currently being run under CodeBuild

S3

  • Output S3 Bucket where the artifacts will be stored during a CodePipeline execution (S3 Bucket should already be existing before the creation of the CodePipeline)

Processing

  • List of stages where the build, test, and deployment will be made (Current Limit: 8 Processes can be made)

Label

  • Name of the stage and the codebuild that would be created
  • This will be concatenated to the label of pipeline you entered. For example if you entered “INS-LRN” as pipeline label and processing label is “build”, the created codebuild will be named as “INSLRNbuild”

Container

  • Could be an existing ECR image, Docker Images Provided by AWS CodeBuild, or Default. Where Default would use a NodeJs 10.1.0 Docker Image that is provided by the AWS CodeBuild
  • You can refer here for docker images images provided by CodeBuild https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html

Sample Payload

{
  "input": {
    "pipeline": {
      "label": "test-label"
    },
    "repo": {
      "type": "CodeCommit",
      "name": "test-codecommit-name",
      "branch": "master"
    }
  },
  "output": {
    "webhook": "http://webhook.site/22-22222",
    "s3": "test-s3"
  },
  "processing": [
    {
      "label": "build",
      "container": "aws/codebuild/eb-python-2.7-amazonlinux-64:2.3.2"
    },
		{
      "label": "test",
      "container": "aws/codebuild/eb-python-2.7-amazonlinux-64:2.3.2"
    },
		{
      "label": "deploy",
      "container": "aws/codebuild/eb-python-2.7-amazonlinux-64:2.3.2"
    }
  ]
}