This file contains hidden or 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
| var Docker = require('dockerode'); | |
| var dockerApiClient = new Docker({host: 'http://mdob.io', port:4243}); | |
| dockerApiClient.getEvents({since: ((new Date().getTime()/1000) - 60).toFixed(0)}, function(err, stream) { | |
| if(err) { | |
| console.log(err); | |
| } else { | |
| stream.pipe(process.stdout); | |
| } | |
| }); |
This file contains hidden or 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
| #!/bin/bash | |
| if [ $(git rev-parse --is-bare-repository) = true ] | |
| then | |
| appName=$(basename "$PWD") | |
| else | |
| appName=$(basename $(readlink -nf "$PWD"/..)) | |
| fi | |
| echo "Preparing to deploy $appName" | |
| tarPath="$HOME/tmp/$appName.tar" | |
| ipaddr=$(ip addr show eth0 | grep inet | head -n1 | awk '{ print $2 }') |
This file contains hidden or 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
| docker pull shykes/couchdb | |
| docker run -d -p 5984 shykes/couchdb |
This file contains hidden or 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
| export GIT_WORK_TREE=/root/apps/test | |
| git checkout -f | |
| /bin/bash /root/apps/test/scripts/restart.sh && exit 0 |
This file contains hidden or 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
| docker -H tcp://$myip:4243/ inspect [CONTAINER ID] | grep IPAddress | cut -d '"' -f 4 |
This file contains hidden or 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
| addr=$(ip addr show eth0 | grep inet | head -n1 | awk '{ print $2 }') | |
| echo ${addr/\/[0-9][0-9]/} |
This file contains hidden or 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
| #Run docker with interactive tutorial | |
| docker run -v /root/apps/test:/test -i -p 8080:8080 nodeapp /bin/bash -c "node /test/server.js" | |
| #in /etc/init/docker.conf we update to activate remote API via tcp socket for access over HTTP | |
| description "Docker daemon" | |
| start on filesystem and started lxc-net | |
| stop on runlevel [!2345] |
This file contains hidden or 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
| # Nodejs | |
| # Version 0.0.1 | |
| FROM ubuntu | |
| MAINTAINER Matthew S. Dobson <[email protected]> | |
| RUN echo "Updating packages." | |
| #Updated repos to 13.10 so we can get a more up to date node from apt-get | |
| RUN echo "deb http://archive.ubuntu.com/ubuntu saucy main universe" > /etc/apt/sources.list | |
| RUN echo "Done..." |
This file contains hidden or 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
| var apigee = new Apigee.Client({ | |
| orgName:"mdobson", | |
| appName:"sandbox", | |
| logging:true | |
| }); | |
| //You'll need to use the login function to have access to this entity. | |
| apigee.getLoggedInUser(function(error, data, user){ | |
| if(error) { |
This file contains hidden or 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
| #!/bin/bash | |
| PID=`pgrep -fl node` | |
| APPDIR=/root/apps/test | |
| if [ -n "$PID" ] | |
| then | |
| echo "Stopping servers : ${PID}" | |
| echo "$PID" | awk '{ print $1 }' | xargs kill | |
| sleep 2 | |
| fi | |
| cd $APPDIR |