Beispiel #1
0
        private static async Task TransferRegistryArtifacts(Options options)
        {
            var exportOptionsDisplay = options.ExportPipeline.Options != null?string.Join(", ", options.ExportPipeline.Options) : "";

            var importOptionsDisplay = options.ImportPipeline.Options != null?string.Join(", ", options.ImportPipeline.Options) : "";

            Console.WriteLine($"Starting ContainerRegistryTransfer...");
            Console.WriteLine();
            Console.WriteLine($"Azure Environment properties:");
            Console.WriteLine($"  MIClientId: {options.MIClientId}");
            Console.WriteLine($"  SPClientId: {options.SPClientId}");
            Console.WriteLine($"  AzureEnvironment: {options.AzureEnvironment.Name}");
            Console.WriteLine($"  SubscriptionId: {options.SubscriptionId}");
            Console.WriteLine($"======================================================================");
            Console.WriteLine($"ExportPipeline properties:");
            Console.WriteLine($"  ResourceGroupName: {options.ExportPipeline.ResourceGroupName}");
            Console.WriteLine($"  RegistryName: {options.ExportPipeline.RegistryName}");
            Console.WriteLine($"  ExportPipelineName: {options.ExportPipeline.PipelineName}");
            Console.WriteLine($"  UserAssignedIdentity: {options.ExportPipeline.UserAssignedIdentity}");
            Console.WriteLine($"  StorageUri: {options.ExportPipeline.ContainerUri}");
            Console.WriteLine($"  KeyVaultSecretUri: {options.ExportPipeline.KeyVaultUri}");
            Console.WriteLine($"  Options: {exportOptionsDisplay}");
            Console.WriteLine($"======================================================================");
            Console.WriteLine($"ImportPipeline properties:");
            Console.WriteLine($"  ResourceGroupName: {options.ImportPipeline.ResourceGroupName}");
            Console.WriteLine($"  RegistryName: {options.ImportPipeline.RegistryName}");
            Console.WriteLine($"  ImportPipelineName: {options.ImportPipeline.PipelineName}");
            Console.WriteLine($"  UserAssignedIdentity: {options.ImportPipeline.UserAssignedIdentity}");
            Console.WriteLine($"  StorageUri: {options.ImportPipeline.ContainerUri}");
            Console.WriteLine($"  KeyVaultSecretUri: {options.ImportPipeline.KeyVaultUri}");
            Console.WriteLine($"  Options: {importOptionsDisplay}");
            Console.WriteLine($"======================================================================");
            Console.WriteLine();

            var registryClient = AzureHelper.GetContainerRegistryManagementClient(options);
            var keyVaultClient = AzureHelper.GetKeyVaultManagementClient(options);

            var exportClient   = new ExportClient(registryClient, keyVaultClient, options);
            var exportPipeline = await exportClient.CreateExportPipelineAsync().ConfigureAwait(false);

            var importClient   = new ImportClient(registryClient, keyVaultClient, options);
            var importPipeline = await importClient.CreateImportPipelineAsync().ConfigureAwait(false);

            Console.WriteLine();
            Console.WriteLine($"======================================================================");
            Console.WriteLine($"Your importPipeline '{importPipeline.Name}' will run automatically.");
            Console.WriteLine($"Would you like to run your exportPipeline '{options.ExportPipeline.PipelineName}'? [Y/N]");
            var response = Console.ReadLine();

            if (string.Equals("Y", response, StringComparison.InvariantCultureIgnoreCase))
            {
                Console.WriteLine("Validating pipelineRun configurations for export.");
                options.ExportPipelineRun.Validate();
                await exportClient.ExportImagesAsync(exportPipeline).ConfigureAwait(false);
            }

            Console.WriteLine("ContainerRegistryTransfer completed. Goodbye!");
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            ExportClient client = new ExportClient("mt5");

            client.TickRecieved += client_TickRecieved;

            client.Open();

            Console.WriteLine("Connected to server... Press ant key to exit");
            Console.ReadKey();

            client.Close();
        }
Beispiel #3
0
 private ActivityExportClient(ExportClient exportClient)
 {
     _exportClient = exportClient;
 }
 private AccountExportClient(ExportClient exportClient)
 {
     _exportClient = exportClient;
 }
Beispiel #5
0
 private CustomObjectExportClient(ExportClient exportClient)
 {
     _exportClient = exportClient;
 }
Beispiel #6
0
        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            try
            {
                base.ApplicationStartup(container, pipelines);

                pipelines.EnableBasicAuthentication(new BasicAuthenticationConfiguration(
                                                        container.Resolve <IUserValidator>(),
                                                        "MyRealm"));

                var httpClient = new HttpClient()
                {
                    BaseAddress = new Uri(ConfigurationManager.AppSettings["WorkbenchUrl"])
                };

                httpClient.DefaultRequestHeaders.Authorization = !string.IsNullOrEmpty(ConfigurationManager.AppSettings["WorkbenchApiKey"]) ?
                                                                 new AuthenticationHeaderValue("Bearer ", ConfigurationManager.AppSettings["WorkbenchApiKey"]) :
                                                                 new AuthenticationHeaderValue("Basic", (ConfigurationManager.AppSettings["WorkbenchUserName"] + ":" + ConfigurationManager.AppSettings["WorkbenchPassword"].FromBase64()).ToBase64());

                var sapClient   = ServerConnection.Current;
                var wbtrfClient = new WorkbenchTrfClient(new HttpClient());
                var client      = new Client(httpClient);
                var company     = sapClient.GetCompany();

                container.Register((c, p) =>
                {
                    return(new Client(httpClient));
                });

                container.Register((c, p) =>
                {
                    return(ServerConnection.Current);
                });

                container.Register((c, p) =>
                {
                    return(ServerConnection.Current.GetCompany());
                });


                container.Register((c, p) =>
                {
                    return(new ImportBase(client, company, wbtrfClient));
                });


                container.Register((c, p) =>
                {
                    return(new ExportBase(client, company, wbtrfClient));
                });


                container.Register((c, p) =>
                {
                    return(new ExportJobs(client, company, wbtrfClient));
                });

                container.Register((c, p) =>
                {
                    return(new ExportClient(new ExportJobs(client, company, wbtrfClient),
                                            new ExportGLJournals(client, company, wbtrfClient),
                                            new ExportAPInvoices(client, company, wbtrfClient),
                                            new ExportARInvoices(client, company, wbtrfClient)));
                });

                container.Register((c, p) =>
                {
                    return(new ExportProcessBatch(new ExportJobs(client, company, wbtrfClient),
                                                  new ExportGLJournals(client, company, wbtrfClient),
                                                  new ExportAPInvoices(client, company, wbtrfClient),
                                                  new ExportARInvoices(client, company, wbtrfClient)));
                });

                container.Register((c, p) =>
                {
                    return(new ExportAPInvoices(client, company, wbtrfClient));
                });

                current = (ExportClient)container.Resolve(typeof(ExportClient));
            }
            catch (Exception ex)
            {
                Helpers.LogAppError($"{ex.InnerException} {ex.Message}");
            }
        }
 private AccountExportClient(ExportClient exportClient)
 {
     _exportClient = exportClient;
 }
 private ContactExportClient(ExportClient exportClient)
 {
     _exportClient = exportClient;
 }
 private CustomObjectExportClient(ExportClient exportClient)
 {
     _exportClient = exportClient;
 }
 private ContactExportClient(ExportClient exportClient)
 {
     _exportClient = exportClient;
 }