Compare commits

..

4 Commits

Author SHA1 Message Date
cb2400652f 2.1.43 2016-06-07 12:12:25 +02:00
455247eb18 improved docker image testing 2016-06-07 12:12:19 +02:00
b7394ff730 2.1.42 2016-06-07 10:28:33 +02:00
c74bd67008 test 2016-06-07 10:28:21 +02:00
4 changed files with 19 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "npmci",
"version": "2.1.41",
"version": "2.1.43",
"description": "",
"main": "dist/index.js",
"bin": {

View File

@@ -1,3 +1,2 @@
#!/bin/sh
npm -v
node -v

View File

@@ -170,12 +170,15 @@ export class Dockerfile {
bashBare("docker pull " + this.buildTag);
};
test(){
let testFile = plugins.path.join(paths.NpmciTestDir,"test_" + this.version + ".sh");
let testExists = plugins.smartfile.checks.fileExistsSync(testFile);
if(testExists){
bashBare("docker run -v " +
paths.NpmciTestDir + ":/test " +
"--name " + this.containerName + " " + this.buildTag + " /test/" + "test_" + this.version + ".sh");
let testFile:string = plugins.path.join(paths.NpmciTestDir,"test_" + this.version + ".sh");
let testFileExists:boolean = plugins.smartfile.checks.fileExistsSync(testFile);
if(testFileExists){
bashBare("docker run --name npmci_test_container " + this.buildTag + " mkdir /npmci_test");
bashBare("docker cp " + testFile + " npmci_test_container:/npmci_test/test.sh");
bashBare("docker commit npmci_test_container npmci_test_image");
bashBare("docker run npmci_test_image sh /npmci_test/test.sh");
bashBare("docker rm npmci_test_container");
bashBare("docker rmi --force npmci_test_image");
} else {
plugins.beautylog.warn("skipping tests for " + this.cleanTag + " because no testfile was found!");
}