Exemple #1
0
        private void GetEcrActionResources(PipelineActionEcrOptions actionEcrOptions, IDictionary <string, Artifact_> artifacts, out IRepository ecrRepository, out Artifact_ artifact, out IRole role)
        {
            ecrRepository = LocateEcrRepository(actionEcrOptions.EcrRepositoryName,
                                                $"The ECR Repository {actionEcrOptions.EcrRepositoryName} of the pipeline action {actionEcrOptions.Name} was not found",
                                                $"The pipeline action {actionEcrOptions.Name} must have a ECR Repository");

            // Create artifact
            if (string.IsNullOrWhiteSpace(actionEcrOptions.OutputArtifact))
            {
                throw new ArgumentException($"There is no output artifact in the pipeline action {actionEcrOptions.Name}");
            }
            else
            {
                if (artifacts.ContainsKey(actionEcrOptions.OutputArtifact))
                {
                    throw new ArgumentException($"The artifact {actionEcrOptions.OutputArtifact} of the pipeline action {actionEcrOptions.Name} already exists");
                }
                else
                {
                    artifact = new Artifact_(actionEcrOptions.OutputArtifact);
                    artifacts.Add(actionEcrOptions.OutputArtifact, artifact);
                }
            }

            // Locate role
            role = LocateRole(actionEcrOptions.Role, $"The role {actionEcrOptions.Role} of the pipeline action {actionEcrOptions.Name} was not found");
        }
Exemple #2
0
        private void CreateEcrAction(IStage stage, IDictionary <string, Artifact_> artifacts, PipelineActionEcrOptions actionEcrOptions)
        {
            GetEcrActionResources(actionEcrOptions, artifacts, out var ecrRepository, out var artifact, out var role);

            AwsCdkHandler.CreateEcrActionInStage(stage, actionEcrOptions.Name, actionEcrOptions.ImageTag, artifact, ecrRepository, role);
        }