now testing shell
This commit is contained in:
@ -1,16 +1,27 @@
|
||||
import "typings-global";
|
||||
import * as plugins from "./npmci.plugins";
|
||||
export let bash = (commandArg) => {
|
||||
let exitCode = plugins.shelljs.exec(
|
||||
"bash -c \"source /usr/local/nvm/nvm.sh &&" +
|
||||
commandArg +
|
||||
"\""
|
||||
).code;
|
||||
if(exitCode !== 0){
|
||||
process.exit(1);
|
||||
if(!process.env.NPMTS_TEST){
|
||||
let exitCode = plugins.shelljs.exec(
|
||||
"bash -c \"source /usr/local/nvm/nvm.sh &&" +
|
||||
commandArg +
|
||||
"\""
|
||||
).code;
|
||||
if(exitCode !== 0){
|
||||
process.exit(1);
|
||||
}
|
||||
} else {
|
||||
plugins.beautylog.log("ShellExec would be: " + commandArg.blue)
|
||||
}
|
||||
}
|
||||
|
||||
export let bashBare = () => {
|
||||
|
||||
export let bashBare = (commandArg) => {
|
||||
if (!process.env.NPMTS_TEST){
|
||||
let exitCode = plugins.shelljs.exec(commandArg).code;
|
||||
if(exitCode !== 0){
|
||||
process.exit(1);
|
||||
}
|
||||
} else {
|
||||
plugins.beautylog.log("ShellExec would be: " + commandArg.blue)
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import * as plugins from "./npmci.plugins"
|
||||
import * as NpmciEnv from "./npmci.env";
|
||||
|
||||
import {bashBare} from "./npmci.bash";
|
||||
export let build = function(){
|
||||
let done = plugins.q.defer();
|
||||
readDockerfiles()
|
||||
@ -104,7 +104,7 @@ export class Dockerfile {
|
||||
if(!this.buildTag){
|
||||
this.patchContents();
|
||||
let tag = dockerTag(this.repo,this.version);
|
||||
plugins.shelljs.exec("docker build -t " + tag + " -f " + this.filePath + " .");
|
||||
bashBare("docker build -t " + tag + " -f " + this.filePath + " .");
|
||||
this.buildTag = tag;
|
||||
NpmciEnv.dockerFilesBuilt.push(this);
|
||||
this.restoreContents();
|
||||
@ -115,7 +115,7 @@ export class Dockerfile {
|
||||
};
|
||||
push(){
|
||||
if(this.buildTag){
|
||||
plugins.shelljs.exec("docker push " + this.buildTag);
|
||||
bashBare("docker push " + this.buildTag);
|
||||
} else {
|
||||
plugins.beautylog.error("Dockerfile hasn't been built yet!");
|
||||
}
|
||||
|
Reference in New Issue
Block a user