EcrBuildAndPublishActionProps Struct
Construction properties of the EcrBuildAndPublishAction.
Example
import * as ecr from 'aws-cdk-lib/aws-ecr';
declare const pipeline: codepipeline.Pipeline;
declare const repository: ecr.IRepository;
const sourceOutput = new codepipeline.Artifact();
// your source repository
const sourceAction = new codepipeline_actions.CodeStarConnectionsSourceAction({
actionName: 'CodeStarConnectionsSourceAction',
output: sourceOutput,
connectionArn: 'your-connection-arn',
owner: 'your-owner',
repo: 'your-repo',
});
const buildAction = new codepipeline_actions.EcrBuildAndPublishAction({
actionName: 'EcrBuildAndPublishAction',
repositoryName: repository.repositoryName,
registryType: codepipeline_actions.RegistryType.PRIVATE,
dockerfileDirectoryPath: './my-dir', // The path indicates ./my-dir/Dockerfile in the source repository
imageTags: ['my-tag-1', 'my-tag-2'],
input: sourceOutput,
});
pipeline.addStage({
stageName: 'Source',
actions: [sourceAction],
});
pipeline.addStage({
stageName: 'Build',
actions: [buildAction],
});
Properties
Note that Action names must be unique within a single Stage.
dockerfileDirectoryPathstringdockerfile_directory_pathstrdockerfileDirectoryPathStringDockerfileDirectoryPathstringDockerfileDirectoryPath*string#Default: the source repository root level
Optionally, you can provide an alternate directory path if Dockerfile is not at the root level.
imageTagsstring[]image_tagstyping.List[str]imageTagsList<String>ImageTagsstring[]ImageTags*[]*string= latest#registryTypeRegistryTyperegistry_typeRegistryTyperegistryTypeRegistryTypeRegistryTypeRegistryTypeRegistryTypeRegistryType= RegistryType.PRIVATE#repositoryNamestringrepository_namestrrepositoryNameStringRepositoryNamestringRepositoryName*stringrequired#Default: a new Role will be generated
notes
The Pipeline's Role will assume this Role (the required permissions for that will be granted automatically) right before executing this Action. This Action will be passed into your IAction.bind method in the ActionBindOptions.role property.
RunOrder determines the relative order in which multiple Actions in the same Stage execute.
variablesNamespacestringvariables_namespacestrvariablesNamespaceStringVariablesNamespacestringVariablesNamespace*string#Default: a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set