private CodeCommitSourceAction CreateSourceVcsCheckoutAction(Vcs.Repository gitRepo, Artifact_ sourceOutput)
 {
     return(new CodeCommitSourceAction(new CodeCommitSourceActionProps
     {
         ActionName = "Git-checkout-from-CodeCommit-repo",
         Repository = gitRepo,
         Output = sourceOutput,
         Branch = this.settings.GitBranchToBuild,
     }));
 }
        public CicdInfraAsCodeStack(Construct parent, string id, UnicornStoreCiCdStackProps settings)
            : base(parent, id, settings)
        {
            this.settings = settings;

            Repository dockerImageRepo = this.CreateDockerImageRepo();

            Vcs.Repository gitRepo = this.CreateVersionControlRepo();
            this.CreateCiCdPipeline(dockerImageRepo, gitRepo);
        }
        private Pipeline CreateCiCdPipeline(Repository dockerRepo, Vcs.Repository gitRepo)
        {
            Artifact_ sourceCodeArtifact = new Artifact_("Unicorn-Store-Visual-Studio-Solution");

            var buildPipeline = new Pipeline(this, "BuildPipeline",
                                             new PipelineProps
            {
                PipelineName = this.settings.ScopeName,
                Stages       = new[]
                {
                    Helpers.StageFromActions("Source", CreateSourceVcsCheckoutAction(gitRepo, sourceCodeArtifact)),
                    Helpers.StageFromActions("Build",
                                             this.CreateDockerImageBuildAction(dockerRepo, sourceCodeArtifact),
                                             this.CreateAppDeploymentEnvironmentBuildAction(sourceCodeArtifact)
                                             ),
                    Helpers.StageFromActions("Restart-the-App", this.CreateLambdaInvokeAction())
                }
            }
                                             );;

            return(buildPipeline);
        }