Composable has an SDK for deploying resources between two instances of Composable. For example, a source instance may be a development environment and the target instance may be the production environment. Resources can include Dataflows, QueryViews, DataPortals, Keys, WebApps, etc. Resources need to be in Composable Folders before deploying.
The Composable Deployment SDK can be used against any .NET language (C#, F#, VB, etc.). For example, with C#, you can create a console application, configure source, target, and deployment settings, compile the code, and then run the console app. [See Composable Docs for more detailed instructions.] However, sometimes you want to change the Folders being deploying, or adjust some deployment settings. If using C#, you would then need to either adjust the code and recompile, or provide enough command line parameters to make deployment changes without recompiling. This is where PowerShell can be useful, in that you can adjust the script without recompiling.
Below is an example PowerShell script showing some of the deployment options.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
Using namespace CompAnalytics.Contracts; Using namespace CompAnalytics.Contracts.QueryView; Using namespace CompAnalytics.IServices.Deploy; Using namespace System; Using namespace System.Collections.Generic; Using namespace System.Linq; Add-Type -Path "CompAnalytics.Contracts.dll" Add-Type -Path "CompAnalytics.IServices.dll" Add-Type -AssemblyName System.Configuration #This is needed to load the config file [appdomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $PSScriptRoot + '\DeployResources.exe.config') [Configuration.ConfigurationManager].GetField("s_initState", "NonPublic, Static").SetValue($null, 0) [Configuration.ConfigurationManager].GetField("s_configSystem", "NonPublic, Static").SetValue($null, $null) ([Configuration.ConfigurationManager].Assembly.GetTypes() | where {$_.FullName -eq "System.Configuration.ClientConfigPaths"})[0].GetField("s_current", "NonPublic, Static").SetValue($null, $null) $folderMaping = New-Object System.Collections.Generic.List[FolderMapping]; $map1 = New-Object FolderMapping("/Curation", "/Curation"); $folderMaping.Add($map1); $map2 = New-Object FolderMapping("/Foundation", "/Foundation"); $folderMaping.Add($map2); $map3 = New-Object FolderMapping("/FrontEnd", "/FrontEnd"); $folderMaping.Add($map3); $map4 = New-Object FolderMapping("/Catalog", "/Catalog"); $folderMaping.Add($map4); $assemblies = New-Object System.Collections.Generic.List[string]; $assemblies.Add("CompAnalytics.Execution.Modules"); $assemblies.Add("CompAnalytics.Execution.Modules.Activation"); $assemblies.Add("CompAnalytics.Extension.Forms"); $assemblies.Add("CompAnalytics.Extension.Sql"); $assemblies.Add("CompAnalytics.Extension.SpreadSheet"); $assemblies.Add("CompAnalytics.Extension.Automapper"); $assemblies.Add("CompAnalytics.Extension.Azure"); $assemblies.Add("CompAnalytics.Extension.Tables"); $assemblies.Add("CompAnalytics.QueryView"); $syncSettings = New-Object SyncSettings; $syncSettings.SourceConnectionSettings = [ConnectionSettings]@{ Uri = New-Object System.Uri("https://sourceserver.com/CompAnalytics/"); AuthMode = [AuthMode]::Form; FormCredential = New-Object System.Net.NetworkCredential("Deployment", "fakepassword") }; $syncSettings.TargetConnectionSettings = [ConnectionSettings]@{ Uri = New-Object System.Uri("http://targetserver.com/CompAnalytics/"); AuthMode = [AuthMode]::Windows }; $syncSettings.Folders = $folderMaping; $syncSettings.SyncPermissions = $false; $syncSettings.SyncRetentionSettings = $false; $syncSettings.MissingKeyBehavior = [MissingKeyBehavior]::Copy; $syncSettings.ExtensionAssemblies = $assemblies; $syncer = New-Object FolderSyncer($syncSettings); $syncer.Sync(); |