Red Gate forums :: View topic - Install on IIS
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

Install on IIS

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



Joined: 06 Dec 2013
Posts: 34
Location: Netherlands

PostPosted: Fri Dec 06, 2013 2:31 pm    Post subject: Install on IIS Reply with quote

Hello Redgate,

I started today with exploring the Deployment manager. I've found lots of awesome stuff but i've problems when rolling out a package to IIS sites.

I don't seem to find a parameter for hostname bindings.

I also get this warning. Maybe it is actually the problem:

Code:
2013-12-06 13:58:46 +01:00 INFO   Updating IIS website *sitename*. You can use the RedGateWebSiteName project variable to override an IIS site name. If you don't specify the variable, the package name is used.
2013-12-06 13:58:47 +01:00 WARN   Could not find IIS website *sitename* on the local machine. You can use the RedGateWebSiteName project variable to override an IIS site name or specify a virtual directory. If you don't specify the variable, the package name is used.
2013-12-06 13:58:48 +01:00 INFO   Created an application pool 'Sites' for .NET v4.0


Edit:
I use the variables:
RedGateCreateWebSiteOnPort
RedGateCreateWebSiteApplicationPool
RedGateWebSiteName
Back to top
View user's profile Send private message
csmith



Joined: 30 Jun 2011
Posts: 114
Location: Cambridge

PostPosted: Fri Dec 06, 2013 4:37 pm    Post subject: Reply with quote

Hi

Did you create a new release after you added RedGateWebSiteName variable and before you deployed it?

Releases in Deployment Manager are immutable, which means that you need to create a new release every time you change package steps and variables, for it to affect your deployment.

While immutability of releases guarantees reliability during deployments, it can be painful when you are changing project configuration!

Best regards,
Chris
_________________
Chris Smith
Project Manager
Deployment Manager
Back to top
View user's profile Send private message
jochem4207



Joined: 06 Dec 2013
Posts: 34
Location: Netherlands

PostPosted: Mon Dec 09, 2013 9:48 am    Post subject: Reply with quote

Thanks for the reply,

I will check that out soon today.
Also the a other question came up:

Is it possible to define redgate variables other than key value pairs. (To replace bigger parts in the config)

For example:

Code:
<config messageServerUrl = ($CustomRedGateServerUrl$)>

In the variable manager: CustomRedGateServerUrl = "some url"

Greetings,
Jochem
Back to top
View user's profile Send private message
justin.caldicott



Joined: 20 Apr 2011
Posts: 55

PostPosted: Mon Dec 09, 2013 10:00 am    Post subject: Reply with quote

Hi,

You can use web config transforms for this purpose. Eg. web.Testing.config and web.Production.config, where Testing and Production are matching your environment names. Deployment Manager will apply these at deployment time.

We'd like to do this in a more elegant way, and there is a UserVoice item for this which you can vote for:

http://redgate.uservoice.com/forums/176290-deployment-manager/suggestions/3578134-allow-variables-to-control-all-sections-in-config-

Best wishes,

Justin
_________________
Justin Caldicott
Product Manager - Deployment Manager
Red Gate
Back to top
View user's profile Send private message
jochem4207



Joined: 06 Dec 2013
Posts: 34
Location: Netherlands

PostPosted: Mon Dec 09, 2013 10:16 am    Post subject: Reply with quote

Hey,

I've voted for the uservoice feature. I also see it is a planned feature. Is there any release date availble ?

Thanks for the fast reply.

Greets
Back to top
View user's profile Send private message
justin.caldicott



Joined: 20 Apr 2011
Posts: 55

PostPosted: Mon Dec 09, 2013 10:23 am    Post subject: Reply with quote

You're welcome.

Actually we've got a meeting this afternoon where we'll be discussing upcoming work. I've got a proposed solution, but we need to spike a few things first.

I'll update the UserVoice item as I know more.

Thanks,

Justin
_________________
Justin Caldicott
Product Manager - Deployment Manager
Red Gate
Back to top
View user's profile Send private message
jochem4207



Joined: 06 Dec 2013
Posts: 34
Location: Netherlands

PostPosted: Fri Dec 13, 2013 9:09 am    Post subject: Re: Reply with quote

justin.caldicott wrote:
You're welcome.

Actually we've got a meeting this afternoon where we'll be discussing upcoming work. I've got a proposed solution, but we need to spike a few things first.

I'll update the UserVoice item as I know more.

Thanks,

Justin


Hey Justin,

Is there any news about this idea/issue?


Edit: About the topicstart.

When I use RedGateWebsiteName it does give a name to the IIS Site but the host name still keeps empty.

Like this uservoice: http://redgate.uservoice.com/forums/176290-deployment-manager/suggestions/4123189-variable-to-set-iis-website-binding

Thanks
Back to top
View user's profile Send private message
justin.caldicott



Joined: 20 Apr 2011
Posts: 55

PostPosted: Fri Dec 13, 2013 6:17 pm    Post subject: Reply with quote

Hi,

Unfortunately nothing conclusive from that meeting on this specific topic, but I suspect we might not tackle it too soon.

Did you try using web.config transforms to achieve this?

The solution I was imagining should also be possible using a predeploy.ps1. If you want to explore it, I was thinking to apply the web deploy parameters.xml concept:
http://msdn.microsoft.com/en-us/library/ff398068(v=vs.110).aspx

You create a parameters.xml file that is part of your package. That describes the parameters available to configure using name, description and eg. XPath expressions. This way, you can configure anything, quite elegantly from variables in Deployment Manager.

The challenge I saw was calling the web deploy transformation code from the predeploy.ps1. I'm sure it was in the Microsoft.Web.Publishing.Tasks namespace, in or near the ImportParametersFile class. But I got a little confused about how to create file objects to pass to the Files ITaskItem array.

Let us know if you make any progress on this.

Regarding the other UserVoice item, yes I can see how that would be a nice addition. Again, it's not something I expect us to be able to look at right now unfortunately, but do add your votes to the suggestion!

Best wishes,

Justin
_________________
Justin Caldicott
Product Manager - Deployment Manager
Red Gate
Back to top
View user's profile Send private message
jochem4207



Joined: 06 Dec 2013
Posts: 34
Location: Netherlands

PostPosted: Tue Dec 17, 2013 4:43 pm    Post subject: Re: Reply with quote

Hey Justin,

I tried to work on this solution.

I have a Powershell script that read/edits parameters.xml. After that I want to write a script that does the transformation. (see below)

I used this example:
http://stackoverflow.com/questions/8989737/web-config-transforms-outside-of-microsoft-msbuild

-----------------------------------

My stackoverflow question: http://stackoverflow.com/questions/20655456/executing-msbuild-task-from-powershell

Edit:
Deleted some questions

After some more thinking and figuring out i've now
- edit/save/create a XML (e.g. transform.xml)
- Powershell script that execute the transformation (code is on stackoverflow)

-----------------------------------------------------

Quote:
After a lot of testing I have one problem:

In my deploy.ps1 script (i've changed it from pre to deploy) I have the code:


$LocationMsBuild = msbuild.exe
$args = transformFile + Name of task
Start-Process -FilePath $LocationMsBuild -ArgumentList $args | Write-Host

Transformfile:
Code:


<Project ToolsVersion="4.0" DefaultTargets="Demo" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <UsingTask TaskName="TransformXml"
                          AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>
    <Target Name="Convert">
        <TransformXml Source="Old.Web.config"
                      Transform="transform.xml"
                      Destination="Web.config"/>
    </Target>
</Project>


When I run deploy.ps1 from powershell i've no issues, when I deploy the package I still don't have any issues but:

The transformation line doesn't do anything. Is this because of rights that the deployment agent possibly has?

I know for sure this don't work because it has to create a new web.config file (which doesn't exist at this point). and it won't create it.

I've print out an error log:

Code:

Microsoft (R) Build Engine version 4.0.30319.18408
[Microsoft .NET Framework, version 4.0.30319.18408]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 12/18/2013 4:18:10 PM.
Project "D:\Redgate\Api\transformCommand.proj" on node 1 (Convert target(s)).
Convert:
  Transforming Source File: Old.Web.config
D:\Redgate\Communited.Timeblockr.Api\transformCommand.proj(5,9): error : Could not open Source file: Could not find file 'D:\Redgate\Communited.Timeblockr.Api\Old.Web.config'.
  Transformation failed
Done Building Project "D:\Redgate\Api\transformCommand.proj" (Convert target(s)) -- FAILED.

Build FAILED.

"D:\Redgate\Api\transformCommand.proj" (Convert target) (1) ->
(Convert target) ->
  D:\Redgate\Api\transformCommand.proj(5,9): error : Could not open Source file: Could not find file 'D:\Redgate\Api\Old.Web.config'.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.39



Fixed the above problem by deleting the RedG


Fixed the most of that problems now. By using a defaultlocation

--------------------------------------------------------------
Two days later I finially have all stuff working Smile

I can now use any redgate variable in any config with
Code:
xdt:Locator="Match()" xdt:Transform="Replace"


For everyone who is missing this option in redgate to replace any variable with redgate variable, I recommend taking a look into the xml functions of powershell



Greets Jochem
Back to top
View user's profile Send private message
Mike Upton



Joined: 11 May 2011
Posts: 108
Location: Red Gate

PostPosted: Thu Dec 19, 2013 5:37 pm    Post subject: Reply with quote

We already have built-in support for running environment-specific config transforms during a deployment. These are described at the bottom of this documentation page.
_________________
Mike Upton

Software Engineer
Red Gate Software Ltd.
Back to top
View user's profile Send private message
jochem4207



Joined: 06 Dec 2013
Posts: 34
Location: Netherlands

PostPosted: Fri Dec 20, 2013 9:11 am    Post subject: Re: Reply with quote

Mike Upton wrote:
We already have built-in support for running environment-specific config transforms during a deployment. These are described at the bottom of this documentation page.


Hey Mike,

This is true but i wanted to say that I used a deploy powershell to create a xml file. So I can use all variables anywhere I want. After that I call the transform so it get transformed. But I think I'm going to change this so the redgate environment-specific code does this for me.

----

About the new release it's awesome that we can delete or deploys. This cleans up a lot! Also Happy christmas/holidays
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