private async Task <string[]> ExecuteAsync(PowershellLogger logger, string clusterEndPoint, string thumbPrint, string[] packagePaths)
        {
            try
            {
                var client = await new ServiceFabricClientBuilder().ConnectAsync(clusterEndPoint, thumbPrint);
                var tasks  = packagePaths
                             .Select(p => string.IsNullOrWhiteSpace(p) ? SessionState.Path.CurrentFileSystemLocation.Path : p)
                             .Select(p => Path.IsPathRooted(p) ? p : Path.Combine(SessionState.Path.CurrentFileSystemLocation.Path, p))
                             .Select(async p => new { Path = p, Result = await client.CreateDiffPackage(p) });

                var res = await Task.WhenAll(tasks);

                return(res.Where(t => t.Result).Select(t => t.Path).ToArray());
            }
            catch (Exception e)
            {
                logger.LogError(e.Message, e);
            }
            finally
            {
                logger.Stop();
            }

            return(null);
        }
Пример #2
0
        private async Task ExecuteAsync(PowershellLogger logger, string clusterEndPoint, string thumbPrint, string path)
        {
            try
            {
                var client = await new ServiceFabricClientBuilder().ConnectAsync(clusterEndPoint, thumbPrint);
                var apps   = new ServiceFabricSolution(AppsHash, path);
                await client.DeployServiceFabricSolution(apps, UseSymlink.ToBool());
            }
            catch (Exception e)
            {
                logger.LogError(e.Message, e);
            }

            logger.Stop();
        }