Search code examples
.netazure-devopsaws-code-deploy

Is it possible to exclude a file from being deployed using aws codedeploy task from vsts


I want to make continuous integration tasks for my .net web application. I use aws codedeploy task for my application deployment.. Before ths deployment step (after the build step or even before it) I want to exclude my .config file and just keep the version deployed before on the server as is.. is this possible?


Solution

  • Yes, it’s possible.

    You just need to copy the files you need to deploy to a different directory (such as $(Build.ArtifactStagingDirectory)\publish).

    Before AWS CodeDeploy Application Deployment task, add a Copy Files task with below settings:

    Source Folder: $(Build.SourcesDirectory)

    Contents: files you want to deploy

    Target Folder: $(Build.ArtifactStagingDirectory)\publish

    Then in the AWS CodeDeploy Application Deployment task, specify the Revision Bundle as $(Build.ArtifactStagingDirectory)\publish.

    More details, you can refer Deploying .NET Web Applications Using AWS CodeDeploy with Visual Studio Team Services.