Skip to main content

CodePipeline action to lint dockerfiles with hadolint

Project description

cloudcomponents Logo

@cloudcomponents/cdk-codepipeline-dockerfile-linter-action

Build Status cdkdx typescript python

CodePipeline action to lint dockerfiles with hadolint

Install

TypeScript/JavaScript:

npm i @cloudcomponents/cdk-codepipeline-dockerfile-linter-action

Python:

pip install cloudcomponents.cdk-codepipeline-dockerfile-linter-action

How to use

import { Construct, Stack, StackProps } from '@aws-cdk/core';
import { Repository } from '@aws-cdk/aws-codecommit';
import { Pipeline, Artifact } from '@aws-cdk/aws-codepipeline';
import { CodeCommitSourceAction } from '@aws-cdk/aws-codepipeline-actions';
import { CodePipelineDockerfileLinterAction } from '@cloudcomponents/cdk-codepipeline-dockerfile-linter-action';
import { CodePipelineAnchoreInlineScanAction } from '@cloudcomponents/cdk-codepipeline-anchore-inline-scan-action';
export class ContainerAuditStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

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

    const sourceArtifact = new Artifact();

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

    const linterAction = new CodePipelineDockerfileLinterAction({
      actionName: 'Linter',
      input: sourceArtifact,
    });

    const vulnScanAction = new CodePipelineAnchoreInlineScanAction({
      actionName: 'VulnScan',
      input: sourceArtifact,
    });

    new Pipeline(this, 'Pipeline', {
      pipelineName: 'container-audit-pipeline',
      stages: [
        {
          stageName: 'Source',
          actions: [sourceAction],
        },
        {
          stageName: 'Audit',
          actions: [linterAction, vulnScanAction],
        },
      ],
    });
  }
}

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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file cloudcomponents.cdk-codepipeline-dockerfile-linter-action-1.49.0.tar.gz.

File metadata

File hashes

Hashes for cloudcomponents.cdk-codepipeline-dockerfile-linter-action-1.49.0.tar.gz
Algorithm Hash digest
SHA256 05592d19dcb6ea0ce66de7ebfbe1eb83fcaa2a12ed42e32908b94ee9dd944ecb
MD5 1afe6f88103e2e7fbc5c4a9f3d9b9ddf
BLAKE2b-256 d87bf70d781a741cae673c36db839fdfcc2c24ee07a427ca4a8a47bb785016ce

See more details on using hashes here.

File details

Details for the file cloudcomponents.cdk_codepipeline_dockerfile_linter_action-1.49.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cloudcomponents.cdk_codepipeline_dockerfile_linter_action-1.49.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed3e1c73775be56d820fb9d5380354dce0fc8205ee49658ccbacce6963c37204
MD5 6e5fd19964c48e01a8f0094f7410d43a
BLAKE2b-256 ff3f59eb72f4c262271805790037209a54da0946d07774523be36984764013c3

See more details on using hashes here.

Supported by

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