Koschei: create OpenShift Job object

This commit is contained in:
Mikolaj Izdebski 2019-09-13 05:29:53 +02:00 committed by Pierre-Yves Chibon
parent 01453fc961
commit ec30d2cf89
2 changed files with 37 additions and 0 deletions

View file

@ -55,6 +55,19 @@
loop_control:
label: "{{ item.name }}"
- name: Apply Job
include_role: name=openshift/object
vars:
template: job.yml
objectname: "{{ item.name }}-job.yml"
name: "{{ item.name }}"
command: "{{ item.command }}"
with_items:
- name: db-create
command: "koschei-admin create-db && koschei-admin create-collection f29 --display-name 'Fedora Rawhide' --target f29 --bugzilla-product Fedora --bugzilla-version rawhide && koschei-admin create-group php"
loop_control:
label: "{{ item.name }}"
- name: Apply CronJob
include_role: name=openshift/object
vars:

View file

@ -0,0 +1,24 @@
apiVersion: batch/v1
kind: Job
metadata:
name: "job-{{name}}"
spec:
parallelism: 0
template:
spec:
containers:
- name: "job-{{name}}"
image: quay.io/koschei/koschei:latest
command: ["/bin/bash", "-euxc", "{{command}}"]
env:
- name: SUDO_USER
value: "job-{{name}}"
volumeMounts:
- name: config
mountPath: /etc/koschei
readOnly: true
restartPolicy: Never
volumes:
- name: config
secret:
secretName: backend-config