Added playbook for jjb

Change-Id: Ib5b539375fed1db99c7882f91cce34d0fbe6f520
This commit is contained in:
Evgeny Sikachev 2017-08-07 18:12:48 +00:00
parent d1965d736a
commit a8dcade8dc
7 changed files with 60 additions and 6 deletions

View File

@ -1,6 +0,0 @@
[jenkins]
user=USER
password=PASSWORD
url=http://127.0.0.1/jenkins
[job_builder]
ignore_cache=True

View File

@ -13,7 +13,13 @@ parameterized-trigger, pathignore, postbuild-task, project-stats-plugin, publish
publish-over-ssh, rebuild, ruby-runtime, run-condition, scm-api, scp, simple-theme-plugin,
ssh-agent, ssh-credentials, ssh-slaves, subversion, timestamper, token-macro,
translation, windows-slaves, ws-cleanup, zmq-event-publisher]
jenkins_user: jenkins
# Zuul params
zuul_user: zuul
zuul_git_url: git://git.openstack.org/openstack-infra/zuul
# jjb params
jjb_git_url: git://git.openstack.org/openstack-infra/jenkins-job-builder
jjb_auth_username: admin
jjb_auth_password: admin

View File

@ -36,6 +36,7 @@
with_items:
- nodepool
- zuul
- "{{ jenkins_user }}"
- name: Create users
user:
@ -45,3 +46,4 @@
with_items:
- nodepool
- zuul
- "{{ jenkins_user }}"

View File

@ -0,0 +1,40 @@
---
- name: Create jjb directories
file:
path: "{{ item }}"
owner: "{{ jenkins_user }}"
group: "{{ jenkins_user }}"
mode: 0755
state: directory
with_items:
- /etc/jenkins_jobs
- "{{ ci_dir }}/jjb"
- name: Clone jjb repo
git:
repo: "{{ jjb_git_url }}"
dest: "{{ ci_dir}}/jjb"
become: true
become_user: "{{ jenkins_user }}"
- name: Install jjb to virtualenv
command: tox -e venv --notest
args:
chdir: "{{ ci_dir }}/jjb"
become: true
become_user: "{{ jenkins_user }}"
- name: Copy configs
template:
src: "{{ item }}.j2"
dest: "/etc/jenkins_jobs/{{ item }}"
become: true
with_items:
- credentials.conf
- jenkins_jobs.ini
- name: Create jjb symlink
file:
src: /opt/ci/jenkins-job-builder/.tox/venv/bin/jenkins-jobs
dest: /usr/local/bin/jenkins-jobs
state: link

View File

@ -0,0 +1,7 @@
[jenkins]
user={{ jjb_auth_username }}
password={{ jjb_auth_password }}
#TODO(esikachev): Change 8080 to /jenkins
url=http://127.0.0.1:8080
[job_builder]
ignore_cache=True

View File

@ -19,6 +19,11 @@
mode: 0755
state: directory
- name: Install jjb
hosts: localhost
roles:
- jjb
- name: Install zuul
hosts: localhost
roles: