Skip to content

Instantly share code, notes, and snippets.

@moylop260
Last active March 11, 2017 22:48
Show Gist options
  • Select an option

  • Save moylop260/29b6f13122b80036fce3 to your computer and use it in GitHub Desktop.

Select an option

Save moylop260/29b6f13122b80036fce3 to your computer and use it in GitHub Desktop.

travis2docker 3.0.0

# -v /var/run/docker.sock:/var/run/docker.sock"  # To run containers from main
# -v /root/dkr-in-dkr-volume/runbot:/var/lib/docker  # raditz
# -v /mnt/sda1/dkr-in-dkr-volume/runbot:/var/lib/docker  # docker-machine vm

export DOCKER_SHARE_LOCAL_PATH=${HOME}/dkr-in-dkr-volume
t2d git@github.com:Vauxoo/runbot-addons.git 9.0 --run-extra-args="--privileged -v ${DOCKER_SHARE_LOCAL_PATH}/runbot:/var/lib/docker --entrypoint=bash"
cd ~/.t2d/script/git_github.com_Vauxoo_runbot-addons.git/9.0/2
sed -i '/docker/d' files/install
# mac: sed -i '' '/docker/d' files/install
echo """
RUN apt-get install libapparmor1 libsystemd-journal0 libnfnetlink0 libxtables10 iptables && \
 wget https://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_1.10.3-0~trusty_amd64.deb -O /tmp/docker.deb && \
 dpkg -i /tmp/docker.deb
VOLUME ['/var/lib/docker']
RUN mkdir -p ${HOME}/odoo-extra/runbot/static/repo/https___github.com_odoo_odoo.git \
 && cp -r /.repo_requirements/odoo/.git /root/odoo-extra/runbot/static/repo/https___github.com_odoo_odoo.git \
 && cd /root/odoo-extra/runbot/static/repo/https___github.com_odoo_odoo.git \
 && git remote remove oca \
 && git remote remove vauxoo \
 && git remote rename odoo origin \
 && git fetch origin \
 && git fetch -p origin +refs/pull/*/head:refs/pull/*
""" >> Dockerfile

echo """
service docker start
docker run -d -p 5000:5000 --name registry registry:2
docker start registry
docker pull vauxoo/odoo-80-image-shippable-auto
""" >> files/entrypoint.sh

10-build.sh

20-run.sh "--name=runbot-FEAT"

Clear instance after use:

  • Execute:
pkill python
service postgresql restart
service docker restart
sleep 2
docker start registry

# Just if is needed
dropdb openerp_test
docker rm -f registry
/entrypoint.sh

# If you want avoid to use the entrypoint
~/odoo-9.0/odoo.py -u runbot_travis2docker -d openerp_test --test-enable --stop-after-init --log-level=debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment