Skip to content

Instantly share code, notes, and snippets.

@mrhillsman
Last active October 14, 2017 04:50
Show Gist options
  • Save mrhillsman/f2f7867ad3ab2399f16d9efc7ffe4ec3 to your computer and use it in GitHub Desktop.
Save mrhillsman/f2f7867ad3ab2399f16d9efc7ffe4ec3 to your computer and use it in GitHub Desktop.
openlab-heredocs-zuul
#!/bin/bash
# Be sure you modify according to your needs
# you need to update the {{}} items below; i.e. {{ public_address }}
cat << EOF > /etc/zuul/zuul.conf
[gearman]
server=127.0.0.1
;port=4730
;ssl_ca=/path/to/ca.pem
;ssl_cert=/path/to/client.pem
;ssl_key=/path/to/client.key
[zookeeper]
hosts={{ zuul.local }}
[gearman_server]
start=true
;ssl_ca=/path/to/ca.pem
;ssl_cert=/path/to/server.pem
;ssl_key=/path/to/server.key
;port=4730
[scheduler]
tenant_config=/etc/zuul/main.yaml
log_config=/etc/zuul/logging.conf
pidfile=/var/run/zuul/zuul.pid
state_dir=/var/lib/zuul
;[merger]
;git_dir=/var/lib/zuul/git
;[email protected]
;git_user_name=zuul
[executor]
user=root
trusted_ro_paths=/opt/zuul-scripts:/var/cache
trusted_rw_paths=/opt/zuul-logs
[web]
listen_address=0.0.0.0
port=9000
[webapp]
listen_address=0.0.0.0
port=8001
status_url=http://{{ public_address }}/status
[connection github]
driver=github
server=github.com
;baseurl=https://review.example.com/r
;baseurl=http://{{ public address }}/r
;user=zuul
;sshkey=/home/zuul/.ssh/id_rsa
;keepalive=60
api_token={{ github_token }}
webhook_token={{ webhook_token }}
verify_ssl=false
[connection smtp]
driver=smtp
server=localhost
port=25
default_from={{ [email protected] }}
default_to={{ [email protected] }}
[connection mydatabase]
driver=sql
dburi=mysql+pymysql://zuul:zuul@localhost/zuul
EOF
cat << EOF > /etc/zuul/main.yaml
- tenant:
name: openlab
source:
github:
config-projects:
- theopenlab/openlab-config
untrusted-projects:
# Order matters, load common job repos first
- theopenlab/openlab-jobs
# Below are just examples, use your actual repos
- theopenlab/gophercloud
- theopenlab/cicd
EOF
cat << EOF > /etc/zuul/logging.conf
[loggers]
keys=root,zuul,gerrit
[handlers]
keys=console,debug,normal
[formatters]
keys=simple
[logger_root]
level=WARNING
handlers=console
[logger_zuul]
level=DEBUG
handlers=debug,normal
qualname=zuul
[logger_gerrit]
level=DEBUG
handlers=debug,normal
qualname=gerrit
[handler_console]
level=WARNING
class=StreamHandler
formatter=simple
args=(sys.stdout,)
[handler_debug]
level=DEBUG
class=logging.handlers.TimedRotatingFileHandler
formatter=simple
args=('/var/log/zuul/debug.log', 'midnight', 1, 30,)
[handler_normal]
level=INFO
class=logging.handlers.TimedRotatingFileHandler
formatter=simple
args=('/var/log/zuul/zuul.log', 'midnight', 1, 30,)
[formatter_simple]
format=%(asctime)s %(levelname)s %(name)s: %(message)s
datefmt=
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment