Created
October 26, 2017 20:52
-
-
Save jwo/c12b96fa5c3bcf7a2a4a43df3e79bbd2 to your computer and use it in GitHub Desktop.
Node app which uses dockerode to run a simple test suite against a Git Repo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone $1 /tmp/app | |
cd /tmp/app | |
git checkout $2 | |
write-good *.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:8 | |
RUN npm install -g write-good | |
ADD clone-run.sh /tmp/clone-run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("Just Playing Along") | |
var Docker = require("dockerode") | |
var docker = new Docker({ socketPath: "/var/run/docker.sock" }) | |
console.log("Started") | |
docker | |
.run( | |
"4d55c12364a5", // in the `images` folder, run `docker build .` and get the container ID | |
["bash", "/tmp/clone-run.sh", "https://github.com/jwo/react-hover-image", "SHA-or-REF"], | |
process.stdout | |
) | |
.then(function(container) { | |
return container.remove() | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment