Deploying Applications to Windows

Hello,

I was wondering if I could get some advice on how to tackle a specific
task. The task I need to perform is to take a build artifact ( a 7zip
archive) and deploy it (extract and copy) to a server in an idempotent
manner ie don’t redeploy the application/build artifact if it already
exists on the target server during a chef-client run. The target server
will be a windows machine and won’t have an SSH server running so I can’t
use the chef deploy resource (if I understand it correctly).

Has someone tackled a similar problem before, are you able to provide any
advice on the best way to tackle this?

My current thinking is to bundle this into a LWRP which will compute a
master checksum of all files in the artifact and then compare this with a
master checksum of the files deployed to the target server.

Thanks in Advance

Dan

The Windows cookbook has an LWRP for this (windows_package) which uses registry entries to ensure idempotence. Take a peek at http://community.opscode.com/cookbooks/windows

From: Dan Powell [mailto:dan@thepowells.co.nz]
Sent: Monday, February 10, 2014 18:02
To: chef@lists.opscode.com
Subject: [chef] Deploying Applications to Windows

Hello,
I was wondering if I could get some advice on how to tackle a specific task. The task I need to perform is to take a build artifact ( a 7zip archive) and deploy it (extract and copy) to a server in an idempotent manner ie don’t redeploy the application/build artifact if it already exists on the target server during a chef-client run. The target server will be a windows machine and won’t have an SSH server running so I can’t use the chef deploy resource (if I understand it correctly).
Has someone tackled a similar problem before, are you able to provide any advice on the best way to tackle this?

My current thinking is to bundle this into a LWRP which will compute a master checksum of all files in the artifact and then compare this with a master checksum of the files deployed to the target server.

Thanks in Advance

Dan

Thanks for the prompt feedback but unfortunately the build artifact is in
fact a web application (I should have confirmed this in the original post),
the artifact is simply a compressed archive of all the web application
files. A deployment of this build artifact consists of copying the files to
the target system then ensuring the appropriate IIS resources are set up
and running.

I would like my cookbook to only re-deploy the web application when I have
configuration or content drift of the application on the target node. I've
had a look at chocolatey but as far as I can see it won't combat
configuration drift of the application, it will only re-deploy when it
detects a newer version is available on the source.

Cheers

On Tue, Feb 11, 2014 at 3:52 PM, Conrad Heiney <
Conrad.Heiney@glidewelldental.com> wrote:

The Windows cookbook has an LWRP for this (windows_package) which uses
registry entries to ensure idempotence. Take a peek at
http://community.opscode.com/cookbooks/windows

From: Dan Powell [mailto:dan@thepowells.co.nz]
Sent: Monday, February 10, 2014 18:02
To: chef@lists.opscode.com
Subject: [chef] Deploying Applications to Windows

Hello,

I was wondering if I could get some advice on how to tackle a specific
task. The task I need to perform is to take a build artifact ( a 7zip
archive) and deploy it (extract and copy) to a server in an idempotent
manner ie don't redeploy the application/build artifact if it already
exists on the target server during a chef-client run. The target server
will be a windows machine and won't have an SSH server running so I can't
use the chef deploy resource (if I understand it correctly).

Has someone tackled a similar problem before, are you able to provide any
advice on the best way to tackle this?

My current thinking is to bundle this into a LWRP which will compute a
master checksum of all files in the artifact and then compare this with a
master checksum of the files deployed to the target server.

Thanks in Advance

Dan

You can use the windows_zipfile resource along with a checksum.

windows_zipfile "c:/path/to/extract" do
action :unzip
source "http://url/path/to/archive.zip"
checksum "fasdfasd..." #<- sha256sum
overwrite true
end

On Mon, Feb 10, 2014 at 9:13 PM, Dan Powell dan@thepowells.co.nz wrote:

Thanks for the prompt feedback but unfortunately the build artifact is in
fact a web application (I should have confirmed this in the original post),
the artifact is simply a compressed archive of all the web application
files. A deployment of this build artifact consists of copying the files to
the target system then ensuring the appropriate IIS resources are set up
and running.

I would like my cookbook to only re-deploy the web application when I have
configuration or content drift of the application on the target node. I've
had a look at chocolatey but as far as I can see it won't combat
configuration drift of the application, it will only re-deploy when it
detects a newer version is available on the source.

Cheers

On Tue, Feb 11, 2014 at 3:52 PM, Conrad Heiney <
Conrad.Heiney@glidewelldental.com> wrote:

The Windows cookbook has an LWRP for this (windows_package) which uses
registry entries to ensure idempotence. Take a peek at
http://community.opscode.com/cookbooks/windows

From: Dan Powell [mailto:dan@thepowells.co.nz]
Sent: Monday, February 10, 2014 18:02
To: chef@lists.opscode.com
Subject: [chef] Deploying Applications to Windows

Hello,

I was wondering if I could get some advice on how to tackle a specific
task. The task I need to perform is to take a build artifact ( a 7zip
archive) and deploy it (extract and copy) to a server in an idempotent
manner ie don't redeploy the application/build artifact if it already
exists on the target server during a chef-client run. The target server
will be a windows machine and won't have an SSH server running so I can't
use the chef deploy resource (if I understand it correctly).

Has someone tackled a similar problem before, are you able to provide any
advice on the best way to tackle this?

My current thinking is to bundle this into a LWRP which will compute a
master checksum of all files in the artifact and then compare this with a
master checksum of the files deployed to the target server.

Thanks in Advance

Dan

Thanks James for the feedback, I ended up solving this problem with the
artifact cookbook by Riot Games (
GitHub - RiotGamesCookbooks/artifact-cookbook: Provides your cookbooks with the Artifact Deploy LWRP). It had the functionality I
was after.

Cheers

On Thu, Feb 13, 2014 at 9:27 AM, James Kessler <
james.kessler@tradingtechnologies.com> wrote:

You can use the windows_zipfile resource along with a checksum.

windows_zipfile "c:/path/to/extract" do
action :unzip
source "http://url/path/to/archive.zip"
checksum "fasdfasd..." #<- sha256sum
overwrite true
end

On Mon, Feb 10, 2014 at 9:13 PM, Dan Powell dan@thepowells.co.nz wrote:

Thanks for the prompt feedback but unfortunately the build artifact is in
fact a web application (I should have confirmed this in the original post),
the artifact is simply a compressed archive of all the web application
files. A deployment of this build artifact consists of copying the files to
the target system then ensuring the appropriate IIS resources are set up
and running.

I would like my cookbook to only re-deploy the web application when I
have configuration or content drift of the application on the target node.
I've had a look at chocolatey but as far as I can see it won't combat
configuration drift of the application, it will only re-deploy when it
detects a newer version is available on the source.

Cheers

On Tue, Feb 11, 2014 at 3:52 PM, Conrad Heiney <
Conrad.Heiney@glidewelldental.com> wrote:

The Windows cookbook has an LWRP for this (windows_package) which uses
registry entries to ensure idempotence. Take a peek at
http://community.opscode.com/cookbooks/windows

From: Dan Powell [mailto:dan@thepowells.co.nz]
Sent: Monday, February 10, 2014 18:02
To: chef@lists.opscode.com
Subject: [chef] Deploying Applications to Windows

Hello,

I was wondering if I could get some advice on how to tackle a specific
task. The task I need to perform is to take a build artifact ( a 7zip
archive) and deploy it (extract and copy) to a server in an idempotent
manner ie don't redeploy the application/build artifact if it already
exists on the target server during a chef-client run. The target server
will be a windows machine and won't have an SSH server running so I can't
use the chef deploy resource (if I understand it correctly).

Has someone tackled a similar problem before, are you able to provide
any advice on the best way to tackle this?

My current thinking is to bundle this into a LWRP which will compute a
master checksum of all files in the artifact and then compare this with a
master checksum of the files deployed to the target server.

Thanks in Advance

Dan