zuul-operator/playbooks/zuul-operator-functional/tasks/create_config.yaml
James E. Blair 1b699279a4 Run a git server in k8s for functional tests
To make the functional tests easier to run locally, run a git server
in k8s instead of on the local machine.

Also, update the secret creation to work with kind as well as minikube.

Change-Id: I4c00129c7105405b0f6256e769486e79c0b173fe
2021-07-20 13:19:59 -07:00

63 lines
1.6 KiB
YAML

- name: create config directory
command: "git clone git://{{ cluster_ip }}:{{ git_server_port }}/config"
args:
chdir: "{{ git_root.path }}"
- name: copy config content
copy:
dest: "{{ git_root.path }}/config/{{ item.name }}"
content: "{{ item.content }}"
loop:
- name: zuul.yaml
content: |
- pipeline:
name: periodic
manager: independent
trigger:
timer:
- time: '* * * * * *'
- nodeset:
name: pod-fedora
nodes:
- name: container
label: pod-fedora-32
- job:
name: test-job
run: test.yaml
# skip zuul-base-jobs for now as it doesn't work with kubectl
roles:
- zuul: zuul/zuul-jobs
parent: null
nodeset: pod-fedora
- project:
periodic:
jobs:
- test-job
- name: test.yaml
content: |
- hosts: localhost
tasks:
- include_role:
name: start-zuul-console
- debug: msg='Demo job is running'
- name: check job volume
stat:
path: /system-dbus
register: _job_volume
failed_when: not _job_volume.stat.isdir
- pause: seconds=30
- name: commit config
shell: |
set -x
git add *.yaml
git commit -m 'Setup config project' || true
git push --set-upstream git://{{ cluster_ip }}:{{ git_server_port }}/config master
args:
chdir: "{{ git_root.path }}/config"