Answers: <p>It may be helpful to look at the different AWS developer services as you are trying to achieve your goal in the wrong services:</p>
  
  <ul>
  <li>Running the specific dotnet testing and publish steps are not done in CodeDeploy.  Rather, they would be done in <a href="https://aws.amazon.com/codebuild/" rel="nofollow noreferrer">AWS CodeBuild</a>, in the AWS Pipeline, or directly on your Jenkins Server.</li>
  <li><a href="https://aws.amazon.com/codedeploy/" rel="nofollow noreferrer">AWS CodeDeploy</a> is for taking your build artifacts and deploying them "to a variety of compute services such as Amazon EC2, AWS Fargate, AWS Lambda, and your on-premises servers".</li>
  <li><a href="https://aws.amazon.com/codepipeline/" rel="nofollow noreferrer">AWS CodePipeline</a> is for modeling an automated workflow.  This service integrates with Jenkins and GitHub.</li>
  </ul>
  
  <p>With these services in mind I think what you are looking for is to start with a new CodePipeline.  This will allow you to start building a model that specifies where you are running your dotnet tests (Jenkins or on AWS) and what to do with your artifacts (publish through Jenkins or AWS CodeDeploy).  This can be accomplished with <a href="https://docs.aws.amazon.com/cdk/api/latest/docs/aws-codepipeline-readme.html" rel="nofollow noreferrer">AWS CDK</a>.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-09-30T14:05:44.193Z
Answers: 2019-09-30T17:39:52.090Z
Answers: 2019-09-30T17:39:52.090Z
Answers: Wesley Rolnick
Body: <p>I'm trying to setup a CI/CD pipeline for a dotnet app which uses AWS Lambda and AWS CDK for infrastructure. The source is on github and we have a Jenkins pipeline which runs the tests and publishes the artifacts. I want to use the artifact and deploy (or better use Code Deploy)</p>
  
  <p>Can I use CodePipeline to run cdk deploy?<br>
  How can I use CodeDeploy to do a <code>dotnet test</code> and <code>dotnet publish</code>? and then pass on the artifact to CodePipeline</p>
  
Tags: <cicd><dotnet><aws-codedeploy><aws-codepipeline>
Title: Setting up CI/CD for an AWS CDK app using AWS CodeBuild/Deploy/Pipeline
UserDisplayName: theabrar
ThreadText: # Setting up CI/CD for an AWS CDK app using AWS CodeBuild/Deploy/Pipeline
  
  (Asked by: username_0 on 2019-09-28)
  
  I'm trying to setup a CI/CD pipeline for a dotnet app which uses AWS Lambda and AWS CDK for infrastructure. The source is on github and we have a Jenkins pipeline which runs the tests and publishes the artifacts. I want to use the artifact and deploy (or better use Code Deploy)
  
  Can I use CodePipeline to run cdk deploy?  
  How can I use CodeDeploy to do a `dotnet test` and `dotnet publish`? and then pass on the artifact to CodePipeline
  
  **Tags:** cicd, dotnet, aws-codedeploy, aws-codepipeline
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-09-30. Score: 3
  
  It may be helpful to look at the different AWS developer services as you are trying to achieve your goal in the wrong services:
  
  * Running the specific dotnet testing and publish steps are not done in CodeDeploy. Rather, they would be done in [AWS CodeBuild](https://aws.amazon.com/codebuild/), in the AWS Pipeline, or directly on your Jenkins Server.
  * [AWS CodeDeploy](https://aws.amazon.com/codedeploy/) is for taking your build artifacts and deploying them "to a variety of compute services such as Amazon EC2, AWS Fargate, AWS Lambda, and your on-premises servers".
  * [AWS CodePipeline](https://aws.amazon.com/codepipeline/) is for modeling an automated workflow. This service integrates with Jenkins and GitHub.
  
  With these services in mind I think what you are looking for is to start with a new CodePipeline. This will allow you to start building a model that specifies where you are running your dotnet tests (Jenkins or on AWS) and what to do with your artifacts (publish through Jenkins or AWS CodeDeploy). This can be accomplished with [AWS CDK](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-codepipeline-readme.html).
  
  
  ---
  
  