Delegate A/S

SolutionImportArg

Configurable import script, which is mainly intended for use by the build server.

Arguments:

  • env=<name of environment> (required)
  • dir=<path to solution folder> (recommended for build server to point at artifacts)
  • managed (optional, defaults to unmanaged)

For example:

  • Managed import to test : fsi SolutionImportArg.fsx /env:Test /dir:"path/to/folder/with/solutions" managed
  • Unmanaged import to dev: fsi SolutionImportArg.fsx /env:Development
 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: 
#load @"_Config.fsx"
open _Config
open DG.Daxif
open DG.Daxif.Common.Utility


let args = fsi.CommandLineArgs |> parseArgs

let env =
  match args |> tryFindArg ["env"; "e"] with
  | Some arg -> Environment.Get arg
  | None     -> failwithf "Missing 'env' argument needed to execute this script."

let solutionFolder =
  args |> tryFindArg ["dir"; "d"] ?| Path.Daxif.crmSolutionsFolder
  
let solutionZipPath = 
  match args |> tryFindArg ["managed"] with
  | Some _ -> "_managed"
  | None   -> ""
  |> sprintf "%s%s.zip" SolutionInfo.name
  |> (++) solutionFolder


Solution.Import(env, solutionZipPath, activatePluginSteps = true, extended = true)
module _Config
namespace DG
namespace DG.Daxif
namespace DG.Daxif.Common
module Utility

from DG.Daxif.Common
val args : Map<string,string>

Full name: SolutionImportArg.args
val parseArgs : (string [] -> Map<string,string>)

Full name: DG.Daxif.Common.Utility.parseArgs
val env : Environment

Full name: SolutionImportArg.env
val tryFindArg : toFind:seq<'b> -> argMap:Map<'b,'c> -> 'c option (requires comparison)

Full name: DG.Daxif.Common.Utility.tryFindArg
union case Option.Some: Value: 'T -> Option<'T>
val arg : string
type Environment =
  {name: string;
   url: Uri;
   creds: Credentials option;
   ap: AuthenticationProviderType option;}
  override ToString : unit -> string
  member connect : ?logger:ConsoleLogger -> Connection
  member executeProcess : exeLocation:string * ?args:#seq<string * string> * ?urlParam:string * ?usrParam:string * ?pwdParam:string * ?apParam:string * ?dmnParam:string * ?paramToString:(string * string -> string) -> unit
  member getCreds : unit -> string * string * string
  member apToUse : AuthenticationProviderType
  static member Create : name:string * url:string * ?ap:AuthenticationProviderType * ?creds:Credentials * ?args:string [] -> Environment
  static member Get : name:string -> Environment

Full name: DG.Daxif.Environment
static member Environment.Get : name:string -> Environment
union case Option.None: Option<'T>
val failwithf : format:Printf.StringFormat<'T,'Result> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.failwithf
val solutionFolder : string

Full name: SolutionImportArg.solutionFolder
module Path

from _Config
module Daxif

from _Config.Path


 Paths Daxif uses to store/load files
val crmSolutionsFolder : string

Full name: _Config.Path.Daxif.crmSolutionsFolder
val solutionZipPath : string

Full name: SolutionImportArg.solutionZipPath
val sprintf : format:Printf.StringFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.sprintf
module SolutionInfo

from _Config
val name : string

Full name: _Config.SolutionInfo.name
type Solution =
  private new : unit -> Solution
  static member Count : env:Environment * solutionName:string * ?logLevel:LogLevel -> unit
  static member Create : env:Environment * name:string * displayName:string * publisherPrefix:string * ?logLevel:LogLevel -> unit
  static member CreatePublisher : env:Environment * name:string * displayName:string * prefix:string * ?logLevel:LogLevel -> unit
  static member EnablePluginSteps : env:Environment * solutionName:string * ?enable:bool * ?logLevel:LogLevel -> unit
  static member Export : env:Environment * solutionName:string * outputDirectory:string * managed:bool * ?extended:bool * ?deltaFromDate:'a0 * ?logLevel:LogLevel -> unit
  static member Extract : solutionFile:string * customizationsFolder:string * xmlMappingFile:string * projectFile:string * ?logLevel:LogLevel -> (LogLevel -> unit)
  static member GenerateCSharpContext : env:Environment * pathToXrmContext:string * outputDir:string * ?solutions:string list * ?entities:string list * ?extraArguments:(string * string) list * ?logLevel:LogLevel -> unit
  static member GenerateTypeScriptContext : env:Environment * pathToXDT:string * outputDir:string * ?solutions:string list * ?entities:string list * ?extraArguments:(string * string) list * ?logLevel:LogLevel -> unit
  static member Import : env:Environment * pathToSolutionZip:string * ?activatePluginSteps:bool * ?extended:bool * ?logLevel:LogLevel -> unit
  ...

Full name: DG.Daxif.Solution
static member Solution.Import : env:Environment * pathToSolutionZip:string * ?activatePluginSteps:bool * ?extended:bool * ?logLevel:LogLevel -> unit