I have a nightly script that should build Debug and Release zip files then upload these via ftp to the client.
Ive always used AfterDropBuild for deployment of a single configuration - which works fine - but building both config's in a single build doesn't seem to work. I was hoping that AfterDropBuild would execute twice. I can of course code the tasks in AfterDropBuild to handle both configs but this doesnt feel right.
Is there a better way?
<Target Name="AfterDropBuild">
<CreateProperty Value="$(DropLocation)\ToClient">
<Output PropertyName="DeploymentFolder" TaskParameter="Value" />
</CreateProperty>
<GetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)">
<Output TaskParameter="BuildNumber" PropertyName="BuildNumber"></Output>
</GetBuildProperties>
<CreateProperty Value="%(ConfigurationToBuild.FlavorToBuild)">
<Output PropertyName="ConfigFlavor" TaskParameter="Value" />
</CreateProperty>
<MakeDir Directories="$(DeploymentFolder)" />
<BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)" Name="ZipSite"
Message="Zipping Site">
<Output TaskParameter="Id" PropertyName="ZipStepID" />
</BuildStep>
<!-- get a list of all the files in the published web sites -->
<CreateItem Include="$(OutDir)_PublishedWebSites\Site.Web\**\*.*" >
<Output TaskParameter="Include" ItemName="FilesToZip"/>
</CreateItem>
<CreateItem Include="$(OutDir)\Site.msi" >
<Output TaskParameter="Include" ItemName="FilesToZip"/>
</CreateItem>
<!-- zip the deployment files -->
<Zip Files="@(FilesToZip)"
ZipFileName="$(DeploymentFolder)\Site_$(BuildNumber)_$(ConfigFlavor).zip"
WorkingDirectory="$(OutDir)_PublishedWebSites\Site.Web" />
<BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)" Id="$(ZipStepId)" Status="Succeeded" />
<!-- upload the zip -->
<BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)" Name="UploadZip"
Message="Uploading Zip to Client">
<Output TaskParameter="Id" PropertyName="ZipUploadID" />
</BuildStep>
<CreateItem Include="$(DeploymentFolder)\*.zip" >
<Output TaskParameter="Include" ItemName="FilesToUpload" />
</CreateItem>
<FtpUpload
RemoteUri="ftp://ftp.blahblah.com/"
LocalFiles="@(FilesToUpload)"
RemoteFiles="@(FilesToUpload->'%(RecursiveDir)%(Filename)%(Extension)')"
UserName="user"
Password="password"
/>
<BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)" Id="$(ZipUploadID)" Status="Succeeded" />
</Target>
Thanks