Red Gate forums :: View topic - [OT?] How to compress files on remote server?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
Deployment Manager
Deployment Manager forum

[OT?] How to compress files on remote server?

Search in Deployment Manager forum
Post new topic   Reply to topic
Jump to:  
Author Message
swinghouse



Joined: 12 Sep 2011
Posts: 95

PostPosted: Tue Jan 15, 2013 2:56 pm    Post subject: [OT?] How to compress files on remote server? Reply with quote

Pardon me if this is a bit off topic, but I've run into the following problem:

I run NuGet Pack on my TeamCity server to create NuGet packages that Deployment Manager can consume. This generally works very well, but in one instance I need to package about 2 GB's worth of files (don't ask!) and now the going get tough...

The first error, reported by NuGet Pack in TeamCity, was quickly remedied:

Quote:
Failed to publish artifacts. Artifact size exceeds maximum allowed size of 300000000 bytes


I was prepared for this thanks to your description at the end of this document: http://www.red-gate.com/supportcenter/Content/Deployment_Manager/help/1.0/dm_nuget_packages

But the second error has stumped me so far:

Quote:
[pack] Exception of type 'System.OutOfMemoryException' was thrown.


I realize that this is more of a TeamCity rather than Red Gate issue, but I wonder if you have any tips on how to compress files on the source server before they are packed by the build server? This would certainly reduce the risk of the above type of errors and also quicken the build process.

Thanks!

/Mattias
Back to top
View user's profile Send private message
Andy Morris



Joined: 08 Oct 2012
Posts: 4

PostPosted: Thu Jan 17, 2013 2:04 pm    Post subject: [OT?] How to compress files on remote server? Reply with quote

Hi Mattias,

The process of creating the NuGet package will compress the contents and even if you could compress the contents before packaging it would not reduce the size to a significant enough degree.

The pack and unpack process of the NuGet packages occurs in memory so even if you could package it, you may hit a problem on the agent when you attempt to unpack it.

The easiest option to solve this is to reduce the size of the package contents - but this doesn't sound possible from what you wrote. The other option is to take advantage of using multiple package steps in a Deployment Manager project to split up the deployment into more manageable chunks.

Best regards,
Andy
Back to top
View user's profile Send private message
swinghouse



Joined: 12 Sep 2011
Posts: 95

PostPosted: Tue Jan 22, 2013 5:42 pm    Post subject: Reply with quote

Hi Andy,

Thanks for the answer!

Actually, zipping the folder on the source server resultated in a zip file that TeamCity and Deployment Manager could manage! (The folder in question contains image files.)

Our solution is a bit convoluted but it does the trick:

1. A scheduled task on the source server runs a ps1 script that creates a zip file.

For this we use the Write-Zip cmdlet from PowerShell Community Extensions

2. A scheduled build on the TeamCity server creates a NuGet package.

3. Deployment Manager pulls this NuGet package from TeamCity.

4. Deployment Manager executes a PostDeploy.ps1 script that extracts the files on the target server.

Here we use the Expand-Archive cmdlet from PowerShell Community Extensions.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group