How to set up you own simple Jenkins CI inside a container to build meteor a meteor project from a git url and push it to a folder somewhere.

This build assumes you have already got meteor running using the meteorhacks/meteord:base image, which by default will grab your meteor bundle from the directory at: ~/app

##Create jenkins container

docker run -d --name jenkinsci --restart=always -p 8080:8080 -p 50000:50000 -v /var/jenkins_home jenkins

Point your browser at your docker url:8080, Go to Manage Jenkins, Manage Plugins, install git plugin.

##Install meteor on the jenkins server

docker exec -it jenkinsci /bin/bash
curl https://install.meteor.com/ | sh
export PATH=$PATH:$HOME/.meteor
ssh-keygen
#=>Don't use a password
ssh-copy-id MYUSER@172.17.42.1
#=>This ip is the default docker host IP

##Set up a jenkins task with your git address, set poll SCM to every 5 minutes and bash script as follows:

H/5 * * * *
meteor build --architecture=os.linux.x86_64 ./
scp *.tar.gz MYUSER@172.17.42.1:~/app/MYMETEORAPP.tar.gz
ssh MYUSER@172.17.42.1 ‘docker restart MYMETEORCONTAINER && exit

##Next steps:

Use jenkins slave agents, instead of running the build on jenkins host would allow multiple deploy targets.

Making jenkins accessible to the web would allow for github webhooks integration and more effective automated builds.