From 4522f26bf3b9940f5f59013706a564937a25aaf7 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 2 Jul 2021 01:09:16 +1000 Subject: [PATCH] Docker build improvement, fix findFTN(), fix address add for systems --- .gitlab-docker-x86_64.yml | 1 + app/Http/Controllers/SystemController.php | 1 + app/Models/Address.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-docker-x86_64.yml b/.gitlab-docker-x86_64.yml index 243f86d..45ad3a9 100644 --- a/.gitlab-docker-x86_64.yml +++ b/.gitlab-docker-x86_64.yml @@ -27,6 +27,7 @@ docker: - if [ -f init ]; then chmod 500 init; fi - ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true" - echo -n ${CI_COMMIT_SHORT_SHA} > VERSION + - rm -rf vendor/ - docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . - docker push ${CI_REGISTRY_IMAGE}:${VERSION} - docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} diff --git a/app/Http/Controllers/SystemController.php b/app/Http/Controllers/SystemController.php index f88494d..6629fb9 100644 --- a/app/Http/Controllers/SystemController.php +++ b/app/Http/Controllers/SystemController.php @@ -90,6 +90,7 @@ class SystemController extends Controller // Check that a host doesnt already exist ->orWhere(function($query) use ($value) { return $query->where('host_id',$value) + ->where('node_id',0) ->where('point_id',0) ->where('role',DomainController::NODE_NC); }); diff --git a/app/Models/Address.php b/app/Models/Address.php index 08c9fad..6435d19 100644 --- a/app/Models/Address.php +++ b/app/Models/Address.php @@ -96,7 +96,7 @@ class Address extends Model $o = (new self)->active() ->select('addresses.*') ->where('zones.zone_id',$ftn['z']) - ->where('host_id',$ftn['h']) + ->where('host_id',$ftn['n']) ->join('zones',['zones.id'=>'addresses.zone_id']) ->join('domains',['domains.id'=>'zones.domain_id']) ->where('zones.active',TRUE)