Ejemplo n.º 1
0
        /// <summary>
        /// Executes <see cref="GenerateBuildManifestDataCommand"/>. Generates a BuildManifest.json file for given
        /// <see cref="GenerateBuildManifestDataCommand.DropName"/>.
        /// </summary>
        private IIpcResult ExecuteGenerateBuildManifestData(GenerateBuildManifestDataCommand cmd)
        {
            Contract.Requires(cmd != null);
            Contract.Requires(m_buildManifestGenerator != null, "Build Manifest data can only be generated on master");

            BuildManifestData buildManifestData = m_buildManifestGenerator.GenerateBuildManifestData(cmd.DropName);

            return(IpcResult.Success(cmd.RenderResult(buildManifestData)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Executes <see cref="GenerateBuildManifestDataCommand"/>. Generates a BuildManifest.json file for given
        /// <see cref="GenerateBuildManifestDataCommand.DropName"/>.
        /// </summary>
        private IIpcResult ExecuteGenerateBuildManifestData(GenerateBuildManifestDataCommand cmd)
        {
            Contract.Requires(cmd != null);
            Contract.Requires(m_buildManifestGenerator != null, "Build Manifest data can only be generated on master");

            var duplicateEntries = m_buildManifestGenerator.DuplicateEntries(cmd.DropName);

            if (duplicateEntries.Count != 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append($"Operation Register BuildManifest Hash for Drop '{cmd.DropName}' failed due to files with different hashes being uploaded to the same path: ");
                foreach (var entry in duplicateEntries)
                {
                    sb.Append($"[Path: {entry.relativePath}'. RecordedHash: '{entry.recordedHash}'. RejectedHash: '{entry.rejectedHash}'] ");
                }

                return(new IpcResult(IpcResultStatus.ExecutionError, sb.ToString()));
            }

            BuildManifestData buildManifestData = m_buildManifestGenerator.GenerateBuildManifestData(cmd);

            return(IpcResult.Success(cmd.RenderResult(buildManifestData)));
        }