Merge pull request #1120 from rockstardev/cifixrefactor

Fixing CircleCi to run external test only in repo context, small refactor of LndServiceViewModel
This commit is contained in:
Rockstar Developer 2019-11-05 09:41:43 -06:00 committed by GitHub
commit c62aeb670a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 23 deletions

View file

@ -31,7 +31,11 @@ jobs:
- checkout
- run:
command: |
cd .circleci && ./run-tests.sh "ExternalIntegration=ExternalIntegration"
if [ "$CIRCLE_PROJECT_USERNAME" == "btcpayserver" ] && [ "$CIRCLE_PROJECT_REPONAME" == "btcpayserver" ]; then
cd .circleci && ./run-tests.sh "ExternalIntegration=ExternalIntegration"
else
echo "Skipping running ExternalIntegration tests outside of context of main user and repository that have access to secrets"
fi
# publish jobs require $DOCKERHUB_REPO, $DOCKERHUB_USER, $DOCKERHUB_PASS defined

View file

@ -491,6 +491,8 @@ namespace BTCPayServer.Controllers
{
var result = new ServicesViewModel();
result.ExternalServices = _Options.ExternalServices.ToList();
// other services
foreach (var externalService in _Options.OtherExternalServices)
{
result.OtherExternalServices.Add(new ServicesViewModel.OtherExternalService()
@ -536,6 +538,7 @@ namespace BTCPayServer.Controllers
}
}
// external storage services
var storageSettings = await _SettingsRepository.GetSettingAsync<StorageSettings>();
result.ExternalStorageServices.Add(new ServicesViewModel.OtherExternalService()
{
@ -647,7 +650,7 @@ namespace BTCPayServer.Controllers
private IActionResult LndServices(ExternalService service, ExternalConnectionString connectionString, uint? nonce)
{
var model = new LndGrpcServicesViewModel();
var model = new LndServicesViewModel();
if (service.Type == ExternalServiceTypes.LNDGRPC)
{
model.Host = $"{connectionString.Server.DnsSafeHost}:{connectionString.Server.Port}";

View file

@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace BTCPayServer.Models.ServerViewModels
{
public class LndRestServicesViewModel
{
public string BaseApiUrl { get; set; }
public string Macaroon { get; set; }
public string CertificateThumbprint { get; set; }
}
}

View file

@ -1,12 +1,8 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
namespace BTCPayServer.Models.ServerViewModels
{
public class LndGrpcServicesViewModel
public class LndServicesViewModel
{
public string Host { get; set; }
public bool SSL { get; set; }

View file

@ -1,4 +1,4 @@
@model LndGrpcServicesViewModel
@model LndServicesViewModel
@{
ViewData.SetActivePageAndTitle(ServerNavPages.Services);
}