Docker build improvement, fix findFTN(), fix address add for systems

This commit is contained in:
Deon George 2021-07-02 01:09:16 +10:00
parent 54bcdf4b13
commit 4522f26bf3
3 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,7 @@ docker:
- if [ -f init ]; then chmod 500 init; fi - if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true" - ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true"
- echo -n ${CI_COMMIT_SHORT_SHA} > VERSION - 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 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}:${VERSION}
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} - docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}

View File

@ -90,6 +90,7 @@ class SystemController extends Controller
// Check that a host doesnt already exist // Check that a host doesnt already exist
->orWhere(function($query) use ($value) { ->orWhere(function($query) use ($value) {
return $query->where('host_id',$value) return $query->where('host_id',$value)
->where('node_id',0)
->where('point_id',0) ->where('point_id',0)
->where('role',DomainController::NODE_NC); ->where('role',DomainController::NODE_NC);
}); });

View File

@ -96,7 +96,7 @@ class Address extends Model
$o = (new self)->active() $o = (new self)->active()
->select('addresses.*') ->select('addresses.*')
->where('zones.zone_id',$ftn['z']) ->where('zones.zone_id',$ftn['z'])
->where('host_id',$ftn['h']) ->where('host_id',$ftn['n'])
->join('zones',['zones.id'=>'addresses.zone_id']) ->join('zones',['zones.id'=>'addresses.zone_id'])
->join('domains',['domains.id'=>'zones.domain_id']) ->join('domains',['domains.id'=>'zones.domain_id'])
->where('zones.active',TRUE) ->where('zones.active',TRUE)