fix local image dependency detection

This commit is contained in:
Philipp Kunz 2016-06-07 06:05:13 +02:00
parent f28d3cc3d8
commit 8b5cf3bb5f
2 changed files with 12 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -35,16 +35,16 @@ export let readDockerfiles = function(){
export let sortDockerfiles = function(sortableArrayArg:Dockerfile[]){ export let sortDockerfiles = function(sortableArrayArg:Dockerfile[]){
let done = plugins.q.defer(); let done = plugins.q.defer();
let sortedArray:Dockerfile[] = []; let sortedArray:Dockerfile[] = [];
let trackingArray:Dockerfile[] = []; let cleanTagsOriginal = cleanTagsArrayFunction(sortableArrayArg,sortedArray);
let sorterFunctionCounter:number = 0; let sorterFunctionCounter:number = 0;
let sorterFunction = function(){ let sorterFunction = function(){
sortableArrayArg.forEach((dockerfileArg)=>{ sortableArrayArg.forEach((dockerfileArg)=>{
let cleanTags = cleanTagsArrayFunction(sortableArrayArg,trackingArray); let cleanTags = cleanTagsArrayFunction(sortableArrayArg,sortedArray);
if(cleanTags.indexOf(dockerfileArg.baseImage) == -1 && trackingArray.indexOf(dockerfileArg) == -1){ if(cleanTags.indexOf(dockerfileArg.baseImage) == -1 && sortedArray.indexOf(dockerfileArg) == -1){
sortedArray.push(dockerfileArg); sortedArray.push(dockerfileArg);
trackingArray.push(dockerfileArg); };
} else if(cleanTags.indexOf(dockerfileArg.baseImage) != -1){ if(cleanTagsOriginal.indexOf(dockerfileArg.baseImage) != -1){
dockerfileArg.localBaseImageDependent = true; dockerfileArg.localBaseImageDependent = true;
}; };
}); });