HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Is it possible to package an application in a .nupkg when creating an application revision in AWS CodeDeploy?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
nupkgpackageapplicationcreatingrevisioncodedeploypossibleawswhen

Problem

My build process packages my application in a .nupkg instead of a .zip.

Assuming my .nupkg contains a correctly-implemented appspec.yml and is otherwise appropriately bundled, can my deployment revision use it?

Solution

Yes. AWS CodeDeploy bundletype is specified separately from the revision location, so you could upload a .nupkg to Amazon S3, set the bundle type to 'zip', and since a nupkg is simply an archive CodeDeploy will treat it as such and upload it to your EC2 instance.

In your nuspec, make sure your appspec.yml gets placed in the root of your .nupkg. My project contains the appspec.yml and powershell scripts to manage windows services in a directory structure like this:

deploy/appspec.yml
deploy/lib/get.ps1
deploy/lib/start.ps1
deploy/lib/stop.ps1
...


You can include this structure at the root by simply recursively retrieving this directory structure (via double wildcards **) in the nuspec files element:


  


And then after packing and outputting the nupkg, you can create the application revision as below:

Code Snippets

deploy/appspec.yml
deploy/lib/get.ps1
deploy/lib/start.ps1
deploy/lib/stop.ps1
...
<files>
  <file src="deploy\**" target="" />
</files>

Context

StackExchange DevOps Q#37, answer score: 2

Revisions (0)

No revisions yet.