start on getting some class logic to Docker
This commit is contained in:
parent
dd142856d0
commit
ab62b979bd
@ -32,6 +32,7 @@
|
|||||||
"smartfile": "^3.0.10",
|
"smartfile": "^3.0.10",
|
||||||
"smartssh": "^1.0.5",
|
"smartssh": "^1.0.5",
|
||||||
"smartstring": "^2.0.4",
|
"smartstring": "^2.0.4",
|
||||||
|
"through2": "^2.0.1",
|
||||||
"typings-global": "^1.0.3"
|
"typings-global": "^1.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,17 +8,37 @@ export let build = function(){
|
|||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let readDockerfiles = function(){
|
||||||
|
plugins.gulp.dest("./Dockerfile*")
|
||||||
|
.pipe(makeDockerfiles);
|
||||||
|
};
|
||||||
|
|
||||||
class Dockerfile {
|
let makeDockerfiles = function(){
|
||||||
|
return function(file,enc,cb){
|
||||||
|
NpmciEnv.dockerFiles.push(
|
||||||
|
new Dockerfile({
|
||||||
|
filePath:file.path,
|
||||||
|
read:true
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Dockerfile {
|
||||||
repo:string;
|
repo:string;
|
||||||
version:string;
|
version:string;
|
||||||
baseImage:string;
|
baseImage:string;
|
||||||
constructor(){
|
constructor(options:{filePath?:string,fileContents?:string|Buffer,read?:boolean}){
|
||||||
|
if(options.filePath && options.read){
|
||||||
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
build(){
|
build(){
|
||||||
|
|
||||||
};
|
};
|
||||||
|
push(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
import * as plugins from "./npmci.plugins";
|
import * as plugins from "./npmci.plugins";
|
||||||
|
|
||||||
import {GitRepo} from "smartstring";
|
import {GitRepo} from "smartstring";
|
||||||
|
import {Dockerfile} from "./npmci.build.docker"
|
||||||
|
|
||||||
export let repo = new GitRepo(process.env.CI_BUILD_REPO);
|
export let repo = new GitRepo(process.env.CI_BUILD_REPO);
|
||||||
export let dockerTestTag:string;
|
export let dockerTestTag:string;
|
||||||
@ -9,4 +9,5 @@ export let dockerReleaseTag:string;
|
|||||||
|
|
||||||
export let dockerRegistry; // will be set by npmci.prepare
|
export let dockerRegistry; // will be set by npmci.prepare
|
||||||
export let dockerImages;
|
export let dockerImages;
|
||||||
export let dockerFiles;
|
export let dockerFiles:Dockerfile[];
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ import "typings-global";
|
|||||||
export import beautylog = require("beautylog");
|
export import beautylog = require("beautylog");
|
||||||
export let commander = require("commander");
|
export let commander = require("commander");
|
||||||
export let gulp = require("gulp");
|
export let gulp = require("gulp");
|
||||||
|
export let path = require("path");
|
||||||
export let q = require("q");
|
export let q = require("q");
|
||||||
export let request = require("request");
|
export let request = require("request");
|
||||||
export let shelljs = require("shelljs");
|
export let shelljs = require("shelljs");
|
||||||
|
@ -26,11 +26,5 @@ let publishNpm = function(){
|
|||||||
|
|
||||||
let publishDocker = function(){
|
let publishDocker = function(){
|
||||||
let done = plugins.q.defer();
|
let done = plugins.q.defer();
|
||||||
prepare("docker")
|
|
||||||
.then(function(){
|
|
||||||
bash
|
|
||||||
bash("docker push " + env.dockerTag());
|
|
||||||
done.resolve();
|
|
||||||
});
|
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user