Skip to main content

Cdk component that automatically merge branches in codepipelines

Project description

cloudcomponents Logo

@cloudcomponents/cdk-codepipeline-merge-action

Build Status cdkdx typescript python

Cdk component that automatically merge branches in codepipelines

Install

TypeScript/JavaScript:

npm i @cloudcomponents/cdk-codepipeline-merge-action

Python:

pip install cloudcomponents.cdk-codepipeline-merge-action

How to use

import { CodePipelineMergeAction } from '@cloudcomponents/cdk-codepipeline-merge-action';
import { Stack, StackProps } from 'aws-cdk-lib';
import { Repository } from 'aws-cdk-lib/aws-codecommit';
import { Pipeline, Artifact } from 'aws-cdk-lib/aws-codepipeline';
import { CodeCommitSourceAction } from 'aws-cdk-lib/aws-codepipeline-actions';
import { Construct } from 'constructs';

export class CodePipelineMergeActionStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    const repository = new Repository(this, 'Repository', {
      repositoryName: 'merge-action-repository',
    });

    const sourceArtifact = new Artifact();

    const sourceAction = new CodeCommitSourceAction({
      actionName: 'CodeCommit',
      repository,
      output: sourceArtifact,
      branch: 'next',
    });

    const mergeAction = new CodePipelineMergeAction({
      actionName: 'Merge',
      repository,
      sourceCommitSpecifier: 'next',
      destinationCommitSpecifier: 'master',
    });

    new Pipeline(this, 'Pipeline', {
      pipelineName: 'merge-action-pipeline',
      stages: [
        {
          stageName: 'Source',
          actions: [sourceAction],
        },
        {
          stageName: 'Merge',
          actions: [mergeAction],
        },
      ],
    });
  }
}

API Reference

See API.md.

Example

See more complete examples.

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file cloudcomponents.cdk-codepipeline-merge-action-2.4.0.tar.gz.

File metadata

File hashes

Hashes for cloudcomponents.cdk-codepipeline-merge-action-2.4.0.tar.gz
Algorithm Hash digest
SHA256 ce7157437f4dd7d111f045501cdbd9035736684945672f81de3c7c02138bdae3
MD5 02bdcbe92ba2d876a3ace4c0995c0bf2
BLAKE2b-256 af60ce68c2562de5568b1777b8633f7a85af939d685ac2d705fd00a0d53857eb

See more details on using hashes here.

File details

Details for the file cloudcomponents.cdk_codepipeline_merge_action-2.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cloudcomponents.cdk_codepipeline_merge_action-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e461a61c224df827af531cb800ebcd2885db97a67192205784d3a67cfb90f4e
MD5 c5c3e3d7d9bb2d2a2c16817d98b51f97
BLAKE2b-256 3cd14cffc630d2f128ecf421f94bd2e66666bc2c0ae9d46e98c5f0f4e1e45c82

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page