Add mysql to quick-start

This allows us to show build history in the web ui.

Also add a local test playbook for the quickstart which basically
does what the zuul-quick-start job does, but expects to run locally
on a workstation (ie, does not install the docker registry and
docker).

Change-Id: Id62dcf69f48399dab3d1259679bf2fc2ce50460e
This commit is contained in:
James E. Blair 2018-10-15 11:31:23 -07:00
parent 081b715283
commit 8bca70aadc
6 changed files with 38 additions and 1 deletions

View File

@ -27,11 +27,19 @@ services:
- "./playbooks/:/var/playbooks/"
command: "ansible-playbook /var/playbooks/setup.yaml"
zk:
image: zookeeper
image: zookeeper
mysql:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: zuul
MYSQL_USER: zuul
MYSQL_PASSWORD: secret
scheduler:
depends_on:
- gerritconfig
- zk
- mysql
environment:
no_proxy: "${no_proxy},gerrit"
command: "sh -c 'ansible-playbook /var/playbooks/scheduler.yaml; zuul-scheduler -d'"
@ -45,6 +53,7 @@ services:
command: "zuul-web -d"
depends_on:
- scheduler
- mysql
ports:
- "9000:9000"
image: zuul/zuul-web

View File

@ -25,6 +25,11 @@ name=zuul-ci
driver=git
baseurl=https://git.zuul-ci.org/
[connection "mysql"]
name=mysql
driver=sql
dburi=mysql+pymysql://zuul:secret@mysql/zuul
[web]
listen_address=0.0.0.0

View File

@ -17,9 +17,11 @@
success:
gerrit:
Verified: 1
mysql:
failure:
gerrit:
Verified: -1
mysql:
- pipeline:
name: gate
@ -46,6 +48,8 @@
gerrit:
Verified: 2
submit: true
mysql:
failure:
gerrit:
Verified: -2
mysql:

View File

@ -0,0 +1,10 @@
- hosts: localhost
vars:
workspace: /tmp/quickstart-test
local: true
ssh_public_key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
ssh_agent:
stdout: ''
tasks:
- name: Run tasks in ssh agent
include_tasks: main.yaml

View File

@ -1,8 +1,14 @@
- name: Run docker-compose up
when: not local
shell:
cmd: docker-compose up -d
chdir: src/git.openstack.org/openstack-infra/zuul/doc/source/admin/examples
become: true
- name: Run docker-compose up
when: local
shell:
cmd: docker-compose up -d
chdir: ../../doc/source/admin/examples
- name: Wait for Gerrit to start
wait_for:
host: localhost
@ -18,6 +24,7 @@
delay: 1
retries: 120
- name: fetch ssh host keys from gerrit
when: not local
shell: ssh-keyscan -p 29418 localhost >> ~/.ssh/known_hosts
- name: Check if example user exists in Gerrit
uri:
@ -49,6 +56,7 @@
shell:
chdir: "{{ workspace }}/zuul-config/"
executable: /bin/bash
warn: false
cmd: |
{{ ssh_agent.stdout }}
rm zuul.d/jobs.yaml

View File

@ -1,6 +1,7 @@
- hosts: all
vars:
workspace: /tmp/quickstart-test
local: false
roles:
- name: install-docker
use_upstream_docker: false