Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ jobs:
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Restore Nuget Packages
run: dotnet restore TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json
run: |
dotnet restore TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json
dotnet restore TransactionProcessing.SchedulerService/TransactionProcessing.SchedulerService.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json

- name: Build Code
run: dotnet build TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.sln --configuration Release
run: |
dotnet build TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.sln --configuration Release
dotnet build TransactionProcessing.SchedulerService/TransactionProcessing.SchedulerService.sln --configuration Release

- name: Publish API
run: dotnet publish "TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.csproj" --configuration Release --output TransactionProcessor.HealthChecksUI/publishOutput
run: |
dotnet publish "TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.csproj" --configuration Release --output TransactionProcessor.HealthChecksUI/publishOutput
dotnet publish "TransactionProcessing.SchedulerService/TransactionProcessing.SchedulerService/TransactionProcessing.SchedulerService.csproj" --configuration Release --output TransactionProcessor.TransactionProcessing/publishOutput

- name: Install Octopus CLI
run: |
Expand All @@ -35,7 +41,7 @@ jobs:
sudo sh -c "echo deb https://apt.octopus.com/ stable main > /etc/apt/sources.list.d/octopus.com.list" && \
sudo apt update && sudo apt install octopuscli

- name: Pack Files for Octopus
- name: Pack Files for Octopus Health Checks UI
run: >-
octo pack
--outFolder /home/runner/work/SupportTools/TransactionProcessor.HealthChecksUI/
Expand All @@ -45,14 +51,33 @@ jobs:
--format zip
--verbose
--logLevel=verbose

- name: Pack Files for Octopus Scheduler Service
run: >-
octo pack
--outFolder /home/runner/work/SupportTools/TransactionProcessing.SchedulerService/
--basePath /home/runner/work/SupportTools/SupportTools/TransactionProcessing.SchedulerService/publishOutput
--id TransactionProcessor.SchedulerService
--version ${{ steps.get_version.outputs.VERSION }}
--format zip
--verbose
--logLevel=verbose

- name: Push Package to Octopus
- name: Push Package to Octopus Health Checks UI
run: >-
octo push
--server ${{ secrets.OCTOPUS_URL }}
--apiKey ${{ secrets.OCTOPUS_APIKEY }}
--package /home/runner/work/SupportTools/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.${{ steps.get_version.outputs.VERSION }}.zip
--overwrite-mode IgnoreIfExists

- name: Push Package to Octopus Scheduler Service
run: >-
octo push
--server ${{ secrets.OCTOPUS_URL }}
--apiKey ${{ secrets.OCTOPUS_APIKEY }}
--package /home/runner/work/SupportTools/TransactionProcessing.SchedulerService/TransactionProcessing.SchedulerService.${{ steps.get_version.outputs.VERSION }}.zip
--overwrite-mode IgnoreIfExists

- name: Get Release
id: getrelease
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ jobs:
- uses: actions/checkout@v1

- name: Restore Nuget Packages
run: dotnet restore TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json
run: |
dotnet restore TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json
dotnet restore TransactionProcessing.SchedulerService/TransactionProcessing.SchedulerService.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json

- name: Build Code
run: dotnet build TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.sln --configuration Release
run: |
dotnet build TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI.sln --configuration Release
dotnet build TransactionProcessing.SchedulerService/TransactionProcessing.SchedulerService.sln --configuration Release
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
namespace TransactionProcessing.SchedulerService.Jobs
{
using System.Net.Http;
using Microsoft.Extensions.DependencyInjection;
using Quartz;

/// <summary>
///
/// </summary>
/// <seealso cref="TransactionProcessing.SchedulerService.Jobs.IBootstrapper" />
public abstract class BaseBoostrapper : IBootstrapper
{
#region Fields

/// <summary>
/// The job execution context
/// </summary>
protected IJobExecutionContext JobExecutionContext;

/// <summary>
/// The service provider
/// </summary>
protected ServiceProvider ServiceProvider;

/// <summary>
/// The services
/// </summary>
protected IServiceCollection Services;

#endregion

#region Methods

/// <summary>
/// Configures the service additional.
/// </summary>
/// <param name="jobExecutionContext">The job execution context.</param>
public virtual void ConfigureServiceAdditional(IJobExecutionContext jobExecutionContext)
{
// Nothing here
}

/// <summary>
/// Configures the services.
/// </summary>
/// <param name="jobExecutionContext">The job execution context.</param>
public virtual void ConfigureServices(IJobExecutionContext jobExecutionContext)
{
this.Services = new ServiceCollection();
this.JobExecutionContext = jobExecutionContext;

HttpClientHandler httpClientHandler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (message,
cert,
chain,
errors) =>
{
return true;
}
};
HttpClient httpClient = new HttpClient(httpClientHandler);
this.Services.AddSingleton(httpClient);

this.ConfigureServiceAdditional(jobExecutionContext);

this.ServiceProvider = this.Services.BuildServiceProvider();
}

/// <summary>
/// Gets the service.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public virtual T GetService<T>()
{
return this.ServiceProvider.GetService<T>();
}

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace TransactionProcessing.SchedulerService.Jobs
{
using System;
using EstateManagement.Client;
using Microsoft.Extensions.DependencyInjection;
using Quartz;
using SecurityService.Client;

/// <summary>
///
/// </summary>
/// <seealso cref="TransactionProcessing.SchedulerService.Jobs.BaseBoostrapper" />
public class GenerateFileUploadsBootstrapper : BaseBoostrapper
{
#region Methods

/// <summary>
/// Configures the service additional.
/// </summary>
/// <param name="jobExecutionContext">The job execution context.</param>
public override void ConfigureServiceAdditional(IJobExecutionContext jobExecutionContext)
{
this.Services.AddSingleton<ISecurityServiceClient, SecurityServiceClient>();
this.Services.AddSingleton<IEstateClient, EstateClient>();

this.Services.AddSingleton<Func<String, String>>(container => serviceName => { return jobExecutionContext.MergedJobDataMap.GetString(serviceName); });
}

#endregion
}
}
Loading