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.50.0.tar.gz.

File metadata

File hashes

Hashes for cloudcomponents.cdk-codepipeline-dockerfile-linter-action-1.50.0.tar.gz
Algorithm Hash digest
SHA256 ea7e1fadf2dcaef6879ed9e3f0cad1bbfad6e5c839b837045d9f239dbd890879
MD5 48016c1b1ea4ca30cf42135362943e97
BLAKE2b-256 fc8b9a44777a8cfcb00dba97655be730581017b5751f8aa5a41ab279c29dc6c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cloudcomponents.cdk_codepipeline_dockerfile_linter_action-1.50.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d38807e5ed0251ccab9543fa447e112be00e07348cc7ec79a3d343a321311ad0
MD5 9476715516d1a8f66f1c9efff4a4f039
BLAKE2b-256 f6d295247c36b6e8bee55f8764bbcfece9ff94939dc4ed39de9dd2821dec9d8f

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