Added ability to deploy zuul
Change-Id: I2ca5fea220ab339c984be2418f990e424b478b2b
This commit is contained in:
parent
31f8e39591
commit
7f90f520b3
|
@ -1,3 +1,7 @@
|
||||||
|
# Common params
|
||||||
|
ci_dir: /opt/ci
|
||||||
|
|
||||||
|
# Jenkins params
|
||||||
jenkins_version: 1.651
|
jenkins_version: 1.651
|
||||||
jenkins_plugins: [ansicolor, antisamy-markup-formatter, ant, bazaar, build-blocker-plugin,
|
jenkins_plugins: [ansicolor, antisamy-markup-formatter, ant, bazaar, build-blocker-plugin,
|
||||||
build-timeout, conditional-buildstep, copyartifact, credentials, cvs, dashboard-view,
|
build-timeout, conditional-buildstep, copyartifact, credentials, cvs, dashboard-view,
|
||||||
|
@ -9,3 +13,7 @@ parameterized-trigger, pathignore, postbuild-task, project-stats-plugin, publish
|
||||||
publish-over-ssh, rebuild, ruby-runtime, run-condition, scm-api, scp, simple-theme-plugin,
|
publish-over-ssh, rebuild, ruby-runtime, run-condition, scm-api, scp, simple-theme-plugin,
|
||||||
ssh-agent, ssh-credentials, ssh-slaves, subversion, timestamper, token-macro,
|
ssh-agent, ssh-credentials, ssh-slaves, subversion, timestamper, token-macro,
|
||||||
translation, windows-slaves, ws-cleanup, zmq-event-publisher]
|
translation, windows-slaves, ws-cleanup, zmq-event-publisher]
|
||||||
|
|
||||||
|
# Zuul params
|
||||||
|
zuul_user: zuul
|
||||||
|
zuul_git_url: git://git.openstack.org/openstack-infra/zuul
|
|
@ -27,6 +27,7 @@
|
||||||
state: latest
|
state: latest
|
||||||
with_items:
|
with_items:
|
||||||
- virtualenv
|
- virtualenv
|
||||||
|
- tox
|
||||||
|
|
||||||
- name: Create groups for users
|
- name: Create groups for users
|
||||||
group:
|
group:
|
||||||
|
@ -34,7 +35,7 @@
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- nodepool
|
- nodepool
|
||||||
- zuul
|
- "{{ zuul_user }}"
|
||||||
|
|
||||||
- name: Create users
|
- name: Create users
|
||||||
user:
|
user:
|
||||||
|
@ -43,4 +44,4 @@
|
||||||
group: "{{ item }}"
|
group: "{{ item }}"
|
||||||
with_items:
|
with_items:
|
||||||
- nodepool
|
- nodepool
|
||||||
- zuul
|
- "{{ zuul_user }}"
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
---
|
||||||
|
- name: Create zuul directories
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
owner: "{{ zuul_user }}"
|
||||||
|
group: "{{ zuul_user }}"
|
||||||
|
mode: 0755
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{ ci_dir }}/zuul"
|
||||||
|
- /var/www/zuul
|
||||||
|
- /etc/zuul
|
||||||
|
- /var/log/zuul
|
||||||
|
- /var/lib/zuul
|
||||||
|
|
||||||
|
- name: Create zuul files
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
owner: "{{ zuul_user }}"
|
||||||
|
group: "{{ zuul_user }}"
|
||||||
|
mode: 0755
|
||||||
|
state: touch
|
||||||
|
with_items:
|
||||||
|
- /etc/zuul/layout.yaml
|
||||||
|
- /var/lib/zuul/times
|
||||||
|
- /var/log/zuul/gearman-server
|
||||||
|
|
||||||
|
- name: Clone zuul repo
|
||||||
|
git:
|
||||||
|
repo: "{{ zuul_git_url }}"
|
||||||
|
dest: "{{ ci_dir}}/zuul"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ zuul_user }}"
|
||||||
|
|
||||||
|
- name: Install zuul to virtualenv
|
||||||
|
command: tox -e venv --notest
|
||||||
|
args:
|
||||||
|
chdir: "{{ ci_dir }}/zuul"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ zuul_user }}"
|
||||||
|
|
||||||
|
- name: Run fetch-dependencies
|
||||||
|
command: "{{ ci_dir }}/zuul/etc/status/fetch-dependencies.sh"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Install zuul-ui
|
||||||
|
command: "cp -r {{ ci_dir }}/zuul/etc/status/public_html /var/www/zuul/"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ zuul_user }}"
|
||||||
|
|
||||||
|
- name: Copy zuul units
|
||||||
|
template:
|
||||||
|
src: "{{ item }}"
|
||||||
|
dest: /lib/systemd/system/
|
||||||
|
become: true
|
||||||
|
with_items:
|
||||||
|
- zuul.service
|
||||||
|
- zuul-merger.service
|
||||||
|
|
||||||
|
- name: Create zuul symlink
|
||||||
|
file:
|
||||||
|
src: "{{ ci_dir }}/zuul/.tox/venv/bin/zuul"
|
||||||
|
dest: /usr/sbin/zuul-client
|
||||||
|
state: link
|
|
@ -2,7 +2,7 @@
|
||||||
Description=Zuul merger
|
Description=Zuul merger
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/opt/ci/zuul/venv/bin/zuul-merger -d
|
ExecStart=/opt/ci/zuul/.tox/venv/bin/zuul-merger -d
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartPreventExitStatus=255
|
RestartPreventExitStatus=255
|
||||||
Type=idle
|
Type=idle
|
|
@ -2,7 +2,7 @@
|
||||||
Description=Zuul server
|
Description=Zuul server
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/opt/ci/zuul/venv/bin/zuul-server -d
|
ExecStart=/opt/ci/zuul/.tox/venv/bin/zuul-server -d
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartPreventExitStatus=255
|
RestartPreventExitStatus=255
|
||||||
Type=idle
|
Type=idle
|
|
@ -13,8 +13,13 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: Create Jenkins CI directory
|
- name: Create Jenkins CI directory
|
||||||
file:
|
file:
|
||||||
path: /opt/ci/files
|
path: "{{ ci_dir }}/files"
|
||||||
owner: jenkins
|
owner: "{{ jenkins_user }}"
|
||||||
group: jenkins
|
group: "{{ jenkins_user }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
|
- name: Install zuul
|
||||||
|
hosts: localhost
|
||||||
|
roles:
|
||||||
|
- zuul
|
||||||
|
|
Loading…
Reference in New Issue