restructure some commands
This commit is contained in:
parent
7ca6578443
commit
9d092aa280
10
ts/npmci.build.docker.ts
Normal file
10
ts/npmci.build.docker.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import * as plugins from "./npmci.plugins"
|
||||
import * as env from "./npmci.env";
|
||||
import {tagDocker} from ".npmci.tag";
|
||||
export let build = function(){
|
||||
let done = plugins.q.defer();
|
||||
done.resolve();
|
||||
return done.promise;
|
||||
}
|
||||
|
||||
let getDockerFiles
|
@ -2,18 +2,14 @@ import "typings-global";
|
||||
import * as plugins from "./npmci.plugins";
|
||||
import {bash} from "./npmci.bash";
|
||||
import * as env from "./npmci.env";
|
||||
import * as buildDocker from "./npmci.build.docker"
|
||||
|
||||
export let build = function(commandArg){
|
||||
switch(commandArg){
|
||||
case "docker":
|
||||
return docker();
|
||||
return buildDocker.build();
|
||||
}
|
||||
}
|
||||
|
||||
let docker = function(){
|
||||
let done = plugins.q.defer();
|
||||
plugins.shelljs.exec("docker build -t " + env.dockerTag());
|
||||
done.resolve();
|
||||
return done.promise;
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,23 +8,3 @@ export let dockerTestTag:string;
|
||||
export let dockerReleaseTag:string;
|
||||
|
||||
export let dockerRegistry = "docker.io"; // will be set by npmci.prepare
|
||||
|
||||
export let dockerTagVersion = function(){
|
||||
if(process.env.CI_BUILD_STAGE == "test"){
|
||||
return "test";
|
||||
} else {
|
||||
return "latest"
|
||||
}
|
||||
}
|
||||
|
||||
export let dockerTag = function(){
|
||||
return dockerRegistry + "/" + repo.user + "/" + repo.repo + ":" + dockerTagVersion() +" .";
|
||||
}
|
||||
|
||||
export let dockerTagTest = function(){
|
||||
return dockerRegistry + "/" + repo.user + "/" + repo.repo + ":test .";
|
||||
}
|
||||
|
||||
export let dockerTagRelease = function(){
|
||||
return dockerRegistry + "/" + repo.user + "/" + repo.repo + ":latest .";
|
||||
}
|
||||
|
22
ts/npmci.tag.docker.ts
Normal file
22
ts/npmci.tag.docker.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import "typings-global";
|
||||
import * as plugins from "./npmci.plugins";
|
||||
import * as env from "./npmci.env";
|
||||
export let dockerTagVersion = function(){
|
||||
if(process.env.CI_BUILD_STAGE == "test"){
|
||||
return "test";
|
||||
} else {
|
||||
return "latest"
|
||||
}
|
||||
}
|
||||
|
||||
export let dockerTag = function(){
|
||||
return dockerRegistry + "/" + repo.user + "/" + repo.repo + ":" + dockerTagVersion() +" .";
|
||||
}
|
||||
|
||||
export let dockerTagTest = function(){
|
||||
return dockerRegistry + "/" + repo.user + "/" + repo.repo + ":test .";
|
||||
}
|
||||
|
||||
export let dockerTagRelease = function(){
|
||||
return dockerRegistry + "/" + repo.user + "/" + repo.repo + ":latest .";
|
||||
}
|
Loading…
Reference in New Issue
Block a user