コード例 #1
0
 private ILocalPath GetTempFolder(BuildTaskInfo taskInfo)
 {
     return(new LocalPath(Path.GetTempPath())
            .Subpath(taskInfo.Environment.ToString())
            .Subpath(taskInfo.BranchName)
            .Subpath("GGPInstallerTemp"));
 }
コード例 #2
0
        private IEnumerable <Actions.IInstallerBuildAction> GetBuildActionList(BuildTaskInfo taskInfo)
        {
            var installerDefinition = _services.InstallerDefinitionReader
                                      .Read(taskInfo);

            Logger.Info($"InstallerVersion = {installerDefinition.Version}; IsCustomizedQAInstaller = {installerDefinition.IsCustomizedInstaller}; Publisher = {installerDefinition.PublisherEmailAddress}; InstallerID = {installerDefinition.InstallerID}");

            var tempFolder = GetTempFolder(taskInfo);

            var actions = new List <Actions.IInstallerBuildAction>();

            actions.Add(new Actions.CleanUpTempFolder(tempFolder, true));

            actions.Add(new Actions.GetLatestGGPApprovalSystemSourceCode());

            foreach (var component in installerDefinition.Components)
            {
                actions.Add(new Actions.DownloadComponentFilesAction(component, tempFolder));
            }

            actions.Add(new Actions.WriteLatestTxtContent(installerDefinition.LatestTxtContent, tempFolder));

            actions.Add(new Actions.ZipComponentsAction(tempFolder));

            actions.Add(new Actions.CompileInstaller());

            actions.Add(new Actions.DeliverInstaller(installerDefinition.Version, installerDefinition.IsCustomizedInstaller));

            actions.Add(new Actions.CleanUpTempFolder(tempFolder, false));

            return(actions);
        }
コード例 #3
0
 public BuildConfiguration(IServerPath ggpApprovalSystemSourceCodeFolder,
                           Optional <ILocalPath> installerRootDeliveryFolder,
                           BuildTaskInfo buildTaskInfo,
                           ISourceControlAdapter sourceControlAdapter)
 {
     this.GGPApprovalSystemSourceCodeFolder = ggpApprovalSystemSourceCodeFolder;
     _installerRootDeliveryFolder           = installerRootDeliveryFolder;
     _buildTaskInfo        = buildTaskInfo;
     _sourceControlAdapter = sourceControlAdapter;
 }
コード例 #4
0
        public InstallerDefinition Read(BuildTaskInfo taskInfo)
        {
            var branchServerPath = _sourceControlAdapter
                                   .CreateServerPath(taskInfo.InstallerContentRootServerPath)
                                   .Subpath(taskInfo.Environment.ToString())
                                   .Subpath(taskInfo.BranchName);

            var installerDefinition = CreateInstallerDefinitionHeader(branchServerPath);

            AppendInstallerContent(installerDefinition, branchServerPath);

            return(installerDefinition);
        }
コード例 #5
0
        public void Build(BuildTaskInfo taskInfo, string ggpApprovalSystemServerPath, string installerDistributionPath)
        {
            var buildConfig = new BuildConfiguration(_services.SourceControlAdapter.CreateServerPath(ggpApprovalSystemServerPath),
                                                     string.IsNullOrEmpty(installerDistributionPath)
                                                        ? Optional <ILocalPath> .None()
                                                        : Optional <ILocalPath> .Some(new LocalPath(installerDistributionPath)),
                                                     taskInfo,
                                                     _services.SourceControlAdapter);

            var buildContext = new InstallerBuildContext(
                _services.LoggerFactory,
                _services.FileSystemAdapter,
                _services.SourceControlAdapter,
                buildConfig);


            var actions = GetBuildActionList(taskInfo);

            foreach (var a in actions)
            {
                a.Execute(buildContext);
            }
        }