Compare commits

...

9 Commits

Author SHA1 Message Date
361d45e086 2.1.24 2016-06-05 10:11:07 +02:00
cb7cb852ea now sorting Dockerfiles correctly 2016-06-05 10:11:01 +02:00
61720f47be 2.1.23 2016-06-05 09:42:14 +02:00
b435fc6bdf update smartstring 2016-06-05 09:42:08 +02:00
70ad41ab86 fix gitlab.yml 2016-06-05 09:38:11 +02:00
d67109b4bc 2.1.22 2016-06-05 09:34:21 +02:00
a29e04f9e3 fix gitlab.yml 2016-06-05 09:33:51 +02:00
9634ca3b4d 2.1.21 2016-06-05 08:53:52 +02:00
d2e7488868 fix 2016-06-05 08:53:46 +02:00
3 changed files with 31 additions and 60 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"name": "npmci", "name": "npmci",
"version": "2.1.20", "version": "2.1.24",
"description": "", "description": "",
"main": "dist/index.js", "main": "dist/index.js",
"bin": { "bin": {
@@ -32,7 +32,7 @@
"shelljs": "^0.7.0", "shelljs": "^0.7.0",
"smartfile": "^3.0.10", "smartfile": "^3.0.10",
"smartssh": "^1.0.5", "smartssh": "^1.0.5",
"smartstring": "^2.0.4", "smartstring": "^2.0.6",
"through2": "^2.0.1", "through2": "^2.0.1",
"typings-global": "^1.0.3" "typings-global": "^1.0.3"
} }

View File

@@ -29,36 +29,23 @@ let readDockerfiles = function(){
let sortDockerfiles = function(){ let sortDockerfiles = function(){
let done = plugins.q.defer(); let done = plugins.q.defer();
let redoSort:boolean; NpmciEnv.dockerFiles.sort(function(a,b){
let sortCounter:number = 0; let cleanTags = [];
let sortFunction = function(){ NpmciEnv.dockerFiles.forEach(function(dockerfileArg){
redoSort = false; cleanTags.push(dockerfileArg.cleanTag);
let notYetBuiltImages:string[] = [];
NpmciEnv.dockerFiles.forEach((dockerFileArg)=>{
notYetBuiltImages.push(dockerFileArg.cleanTag);
}); });
NpmciEnv.dockerFiles.sort(function(a,b){ let aIndex = cleanTags.indexOf(a.cleanTag);
console.log("iteration: " + sortCounter.toString()); let bIndex = cleanTags.indexOf(b.baseImage);
console.log(notYetBuiltImages) console.log(cleanTags);
console.log(a.cleanTag); console.log(a.cleanTag);
let aIndex = notYetBuiltImages.indexOf(a.cleanTag); console.log(b.cleanTag);
if(aIndex != -1){notYetBuiltImages.splice(aIndex,1)} if(bIndex < aIndex && bIndex != -1){
console.log(notYetBuiltImages); return -1;
if(notYetBuiltImages.indexOf(b.cleanTag) != -1){
redoSort = true;
return -1;
} else {
return 0
}
});
if(redoSort && sortCounter <= 50){
sortCounter++;
sortFunction();
} else { } else {
done.resolve(); return 0
} }
}; });
sortFunction(); done.resolve();
return done.promise; return done.promise;
} }