🧑💻 Zuul
Zuul helps you stop merging broken code. If you need CI that properly gate-keeps, check out Zuul.
If you and your team are writing lots and lots of code, you're going to want to check out Zuul (code).
Zuul is a open source continuous integration ("CI") tool that makes sure your code is tested and passing before it gets into your code base. What's important is that Zuul gates your codebase, whereas other tools sometimes let faulty commits go through:
It's right there in the middle of the page – "Stop Merging Broken Code".
Zuul is used by huge organizations like Ampere, Redhat, OVHCloud, and OpenStack, and trusted by many more. Zuul even runs on Volvos, according to an article from ZDNet.
If you're ready to give another CI system a try, check out Zuul.
Running Zool
Zool has an extensive user manual for you to peruse and a dedicated quickstart documentation page which uses docker.
Zuul's set up isn't for the faint of heart, but it is easy to find:
version: '2.1'
services:
gerrit:
image: docker.io/gerritcodereview/gerrit
ports:
- "8080:8080"
- "29418:29418"
environment:
- CANONICAL_WEB_URL=http://localhost:8080/
networks:
- zuul
gerritconfig:
image: docker.io/zuul/zuul-executor
environment:
- http_proxy
- https_proxy
- no_proxy=${no_proxy},gerrit
depends_on:
- gerrit
volumes:
- "sshkey:/var/ssh:z"
- "nodessh:/var/node:z"
- "./playbooks/:/var/playbooks/:z"
- "certs:/var/certs:z"
- "../../../tools/:/var/zuul-tools/:z"
# NOTE(pabelanger): Be sure to update this line each time we change the
# default version of ansible for Zuul.
command: "/usr/local/lib/zuul/ansible/6/bin/ansible-playbook /var/playbooks/setup.yaml"
networks:
- zuul
zk:
image: docker.io/zookeeper
hostname: examples_zk_1.examples_default
volumes:
- "./playbooks/:/var/playbooks/:z"
- "certs:/var/certs:z"
- "./zoo.cfg:/conf/zoo.cfg:z"
command: "sh -c '/var/playbooks/wait-to-start-certs.sh && zkServer.sh start-foreground'"
networks:
- zuul
mysql:
image: docker.io/mariadb
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: zuul
MYSQL_USER: zuul
MYSQL_PASSWORD: secret
# Work around slow db startup when writing TZINFO data.
MYSQL_INITDB_SKIP_TZINFO: 1
networks:
- zuul
scheduler:
depends_on:
- gerritconfig
- zk
- mysql
environment:
- http_proxy
- https_proxy
- no_proxy=${no_proxy},gerrit
- ZUUL_MYSQL_PASSWORD=secret
command: |
sh -c '/var/playbooks/wait-to-start-certs.sh && \
/var/playbooks/wait-to-start.sh && \
zuul-scheduler -f'
# FIXME: The scheduler has no ansible anymore so use the executor image.
# This needs to be changes such that ansible is not required for startup.
image: docker.io/zuul/zuul-scheduler
volumes:
- "${ZUUL_TUTORIAL_CONFIG:-./etc_zuul/}:/etc/zuul/:z"
- "./playbooks/:/var/playbooks/:z"
- "sshkey:/var/ssh:z"
- "certs:/var/certs:z"
networks:
- zuul
web:
command: |
sh -c '/var/playbooks/wait-to-start-certs.sh && \
zuul-web -f'
depends_on:
- scheduler
- mysql
ports:
- "9000:9000"
image: docker.io/zuul/zuul-web
environment:
ZUUL_MYSQL_PASSWORD: secret
volumes:
- "${ZUUL_TUTORIAL_CONFIG:-./etc_zuul/}:/etc/zuul/:z"
- "./playbooks/:/var/playbooks/:z"
- "certs:/var/certs:z"
networks:
- zuul
executor:
privileged: true
environment:
- http_proxy
- https_proxy
- no_proxy=${no_proxy},gerrit,scheduler
- ZUUL_MYSQL_PASSWORD=secret
depends_on:
- scheduler
image: docker.io/zuul/zuul-executor
volumes:
- "${ZUUL_TUTORIAL_CONFIG:-./etc_zuul/}:/etc/zuul/:z"
- "./playbooks/:/var/playbooks/:z"
- "sshkey:/var/ssh:z"
- "logs:/srv/static/logs:z"
- "certs:/var/certs:z"
command: "sh -c '/var/playbooks/wait-to-start-certs.sh && zuul-executor -f'"
networks:
- zuul
node:
build:
dockerfile: node-Dockerfile
context: ./
args:
http_proxy: "${http_proxy}"
https_proxy: "${http_proxy}"
no_proxy: "${no_proxy},gerrit"
volumes:
- "nodessh:/root/.ssh:z"
networks:
- zuul
launcher:
depends_on:
- zk
image: docker.io/zuul/nodepool-launcher
volumes:
- "./playbooks/:/var/playbooks/:z"
- "./etc_nodepool/:/etc/nodepool/:z"
- "certs:/var/certs:z"
ports:
- "8005:8005"
command: "sh -c '/var/playbooks/wait-to-start-certs.sh && nodepool-launcher -f'"
networks:
- zuul
logs:
build:
dockerfile: logs-Dockerfile
context: ./
args:
http_proxy: "${http_proxy}"
https_proxy: "${http_proxy}"
no_proxy: "${no_proxy}"
ports:
- "8000:80"
volumes:
- "logs:/usr/local/apache2/htdocs:z"
networks:
- zuul
volumes:
sshkey:
nodessh:
logs:
certs:
networks:
zuul: