Compiling SSIS Projects with Team City

隐身守侯 提交于 2019-12-11 08:38:49

问题


Has anyone done this? If so, what tools/techniques/approaches did you use?

Is it possible to do with installing the SQL Business Studio Version of Visual Studio?

Thanks in advance!


回答1:


Got it folks...

1) Install MSBuild Extensions

2) Created a Build.Xml file as so...

<Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>
<Target Name="Default">
    <PropertyGroup>
        <OutputRoot>../../../build-artifacts</OutputRoot>
    </PropertyGroup>
    <ItemGroup>
        <SSISProjectFile Include="SSISProject.dtproj"/>
        <SSISProject Include="@(SSISProjectFile)">
            <OutputDirectory>$(OutputRoot)</OutputDirectory>
        </SSISProject>      
    </ItemGroup>
    <ItemGroup>
        <Namespaces Include="Mynamespace">
            <Prefix>DTS</Prefix>
            <Uri>www.microsoft.com/SqlServer/Dts</Uri>
        </Namespaces>
    </ItemGroup>

    <MSBuild.ExtensionPack.Xml.XmlFile 
        TaskAction="UpdateElement" 
        File="EnclarityDataImport.dtsx" 
        XPath="//DTS:Property[@DTS:Name='ConfigurationString']" 
        InnerText="$(MSBuildProjectDirectory)\EnclarityDataImport.dtsConfig"
        Namespaces="@(Namespaces)"/>
    <MSBuild.ExtensionPack.SqlServer.BuildDeploymentManifest InputProject="@(SSISProject)"/>
</Target>

The only trick was the last part of the build here. By default visual studio adds the absolute path to your config and connection string files for your dtsx package. Team City will use these in conjunction with MSBuild extensions to build the package so a local path will break the build because the paths to the build directories in Team City are automatically generated. So using the code above and the $(MSBuildProjectDirectory) you can twiddle the value of the path on your dtsx file so that it points to the path where your compilation is exectuing.




回答2:


Like booyaa says SSIS projects don't need to be compiled, but what i have done is make the .dtconfigs configurable by the build/deployment process.

I do this so that i can run the packages on deployment in different environments. So the build will copy a template of the dtconfig file. this contains tokens- $(Servername) $(ConnectionString) And then i do the replacement on deployment and then execute by wrapping the dtexec in an command.

Not sure about 2012.



来源:https://stackoverflow.com/questions/10289725/compiling-ssis-projects-with-team-city

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!