fix docker testing

This commit is contained in:
Philipp Kunz 2017-10-11 18:14:05 +02:00
parent 38cf8d5ac3
commit d86d47f42b
2 changed files with 9 additions and 9 deletions

View File

@ -71,10 +71,10 @@ class Dockerfile {
let testFileExists = plugins.smartfile.fs.fileExistsSync(testFile);
if (testFileExists) {
// run tests
yield npmci_bash_1.bash('docker run --name npmci_test_container ' + this.buildTag + ' --entrypoint="mkdir" /npmci_test');
yield npmci_bash_1.bash('docker cp ' + testFile + ' npmci_test_container:/npmci_test/test.sh');
yield npmci_bash_1.bash('docker commit npmci_test_container npmci_test_image');
yield npmci_bash_1.bash('docker run npmci_test_image --entrypoint="sh" /npmci_test/test.sh');
yield npmci_bash_1.bash(`docker run --name npmci_test_container --entrypoint="bash" ${this.buildTag} -c "mkdir /npmci_test"`);
yield npmci_bash_1.bash(`docker cp ${testFile} npmci_test_container:/npmci_test/test.sh`);
yield npmci_bash_1.bash(`docker commit npmci_test_container npmci_test_image`);
yield npmci_bash_1.bash('docker run --entrypoint="bash" npmci_test_image -x /npmci_test/test.sh');
yield npmci_bash_1.bash('docker rm npmci_test_container');
yield npmci_bash_1.bash('docker rmi --force npmci_test_image');
}
@ -94,4 +94,4 @@ class Dockerfile {
}
}
exports.Dockerfile = Dockerfile;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kLmNsYXNzZXMuZG9ja2VyZmlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL21vZF9kb2NrZXIvbW9kLmNsYXNzZXMuZG9ja2VyZmlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEseUNBQXdDO0FBQ3hDLHlDQUF3QztBQUN4Qyw4Q0FBb0M7QUFDcEMsd0NBQXVDO0FBR3ZDLHlDQUF3QztBQUV4Qzs7R0FFRztBQUNIO0lBV0UsWUFBYSxPQUE4RTtRQUN6RixJQUFJLENBQUMsU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lBQVk7Z0JBQ1osTUFBTSxpQkFBSSxDQUFDLDhEQUE4RCxJQUFJLENBQUMsUUFBUSx5QkFBeUIsQ0FBQyxDQUFBO2dCQUNoSCxNQUFNLGlCQUFJLENBQUMsYUFBYSxRQUFRLDJDQUEyQyxDQUFDLENBQUE7Z0JBQzVFLE1BQU0saUJBQUksQ0FBQyxxREFBcUQsQ0FBQyxDQUFBO2dCQUNqRSxNQUFNLGlCQUFJLENBQUMsd0VBQXdFLENBQUMsQ0FBQTtnQkFDcEYsTUFBTSxpQkFBSSxDQUFDLGdDQUFnQyxDQUFDLENBQUE7Z0JBQzVDLE1BQU0saUJBQUksQ0FBQyxxQ0FBcUMsQ0FBQyxDQUFBO1lBQ25ELENBQUM7WUFBQyxJQUFJLENBQUMsQ0FBQztnQkFDTixPQUFPLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxxQkFBcUIsR0FBRyxJQUFJLENBQUMsUUFBUSxHQUFHLGlDQUFpQyxDQUFDLENBQUE7WUFDbkcsQ0FBQztRQUNILENBQUM7S0FBQTtJQUVEOztPQUVHO0lBQ0csS0FBSzs7WUFDVCxJQUFJLFdBQVcsR0FBRyxNQUFNLGlCQUFJLENBQUMsbURBQW1ELEdBQUcsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFBO1lBQ2pHLE1BQU0sQ0FBQyxXQUFXLENBQUE7UUFDcEIsQ0FBQztLQUFBO0NBQ0Y7QUFqRkQsZ0NBaUZDIn0=

View File

@ -72,10 +72,10 @@ export class Dockerfile {
let testFileExists: boolean = plugins.smartfile.fs.fileExistsSync(testFile)
if (testFileExists) {
// run tests
await bash('docker run --name npmci_test_container ' + this.buildTag + ' --entrypoint="mkdir" /npmci_test')
await bash('docker cp ' + testFile + ' npmci_test_container:/npmci_test/test.sh')
await bash('docker commit npmci_test_container npmci_test_image')
await bash('docker run npmci_test_image --entrypoint="sh" /npmci_test/test.sh')
await bash(`docker run --name npmci_test_container --entrypoint="bash" ${this.buildTag} -c "mkdir /npmci_test"`)
await bash(`docker cp ${testFile} npmci_test_container:/npmci_test/test.sh`)
await bash(`docker commit npmci_test_container npmci_test_image`)
await bash('docker run --entrypoint="bash" npmci_test_image -x /npmci_test/test.sh')
await bash('docker rm npmci_test_container')
await bash('docker rmi --force npmci_test_image')
} else {