monitor_gating: initial work to deploy the service in openshift
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
parent
a232c72149
commit
ab75a0157a
8 changed files with 215 additions and 0 deletions
56
playbooks/openshift-apps/monitor_gating.yml
Normal file
56
playbooks/openshift-apps/monitor_gating.yml
Normal file
|
@ -0,0 +1,56 @@
|
|||
- name: make the app be real
|
||||
hosts: os_masters_stg[0]:os_masters
|
||||
user: root
|
||||
gather_facts: False
|
||||
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
- "/srv/private/ansible/vars.yml"
|
||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
||||
|
||||
roles:
|
||||
- role: openshift/project
|
||||
app: monitor_gating
|
||||
description: Monitor the packager and gating workflow
|
||||
appowners:
|
||||
- cverna
|
||||
- pingou
|
||||
- asaleh
|
||||
|
||||
- role: openshift/object
|
||||
app: monitor_gating
|
||||
template: imagestream.yml
|
||||
objectname: imagestream.yml
|
||||
|
||||
- role: openshift/object
|
||||
app: monitor_gating
|
||||
template: buildconfig.yml
|
||||
objectname: buildconfig.yml
|
||||
|
||||
- role: openshift/object
|
||||
app: monitor_gating
|
||||
template: configmap.yml
|
||||
objectname: configmap.yml
|
||||
|
||||
- role: openshift/object
|
||||
app: monitor_gating
|
||||
template: secret.yml
|
||||
objectname: secret.yml
|
||||
|
||||
- role: openshift/secret-file
|
||||
app: monitor_gating
|
||||
secret_name: monitor_gating-ssh
|
||||
key: id_rsa
|
||||
privatefile: "git-ssh/monitor_gating"
|
||||
|
||||
- role: openshift/object
|
||||
app: monitor_gating
|
||||
template: deploymentconfig.yml
|
||||
objectname: deploymentconfig.yml
|
||||
|
||||
- role: openshift/start-build
|
||||
app: monitor_gating
|
||||
buildname: monitor_gating-build
|
||||
objectname: monitor_gating-build
|
||||
tags:
|
||||
- build
|
|
@ -0,0 +1,25 @@
|
|||
apiVersion: v1
|
||||
kind: BuildConfig
|
||||
metadata:
|
||||
name: monitor_gating_build
|
||||
labels:
|
||||
environment: "monitor_gating"
|
||||
spec:
|
||||
source:
|
||||
git:
|
||||
{% if env == 'staging' %}
|
||||
uri: https://pagure.io/forks/pingou/fedora-ci/monitor-gating.git
|
||||
ref: "staging"
|
||||
{% else %}
|
||||
uri: https://pagure.io/fedora-ci/monitor-gating/.git
|
||||
ref: "production"
|
||||
{% endif %}
|
||||
strategy:
|
||||
type: Docker
|
||||
triggers:
|
||||
- type: ConfigChange
|
||||
- type: ImageChange
|
||||
output:
|
||||
to:
|
||||
kind: ImageStreamTag
|
||||
name: monitor_gating:latest
|
11
roles/openshift-apps/monitor_gating/templates/configmap.yml
Normal file
11
roles/openshift-apps/monitor_gating/templates/configmap.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% macro load_file(filename) %}{% include filename %}{%- endmacro -%}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: monitor_gating-configmap
|
||||
labels:
|
||||
app: monitor_gating
|
||||
data:
|
||||
runner.cfg: |-
|
||||
{{ load_file('runner.cfg') | indent }}
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: DeploymentConfig
|
||||
metadata:
|
||||
labels:
|
||||
app: monitor_gating
|
||||
name: monitor_gating
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
app: monitor_gating
|
||||
deploymentconfig: monitor_gating
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: monitor_gating
|
||||
deploymentconfig: monitor_gating
|
||||
spec:
|
||||
containers:
|
||||
- name: monitor_gating
|
||||
image: monitor_gating:latest
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /config/
|
||||
readOnly: true
|
||||
- name: monitor_gating-secret-volume
|
||||
mountPath: /config/app-config/
|
||||
readOnly: true
|
||||
- name: monitor_gating-ssh-volume
|
||||
mountPath: /root/.ssh/
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: monitor_gating-configmap
|
||||
- name: monitor_gating-secret-volume
|
||||
secret:
|
||||
secretName: monitor_gating-secret
|
||||
- name: monitor_gating-ssh-volume
|
||||
secret:
|
||||
secretName: monitor_gating-ssh
|
||||
|
||||
triggers:
|
||||
- type: ConfigChange
|
||||
- type: ImageChange
|
||||
imageChangeParams:
|
||||
automatic: true
|
||||
containerNames:
|
||||
- monitor_gating
|
||||
from:
|
||||
kind: ImageStreamTag
|
||||
name: monitor_gating:latest
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: ImageStream
|
||||
metadata:
|
||||
name: "monitor_gating"
|
|
@ -0,0 +1,46 @@
|
|||
{% if env == 'staging' %}
|
||||
fedpkg = "fedpkg-stage"
|
||||
resultsdb = "https://taskotron.stg.fedoraproject.org/resultsdb_api/api/v2.0/results"
|
||||
resultsdb_rdu = "http://resultsdb.ci.centos.org/resultsdb_api/api/v2.0/results"
|
||||
datagrepper = "https://apps.stg.fedoraproject.org/datagrepper/raw"
|
||||
pagure_dist_git = "https://src.stg.fedoraproject.org/"
|
||||
distgit_host = "pkgs.stg.fedoraproject.org"
|
||||
koji_hub = "https://koji.stg.fedoraproject.org/kojihub"
|
||||
bodhi = "https://bodhi.stg.fedoraproject.org"
|
||||
bodhi-cli = "bodhi"
|
||||
bodhi-user = "packagerbot"
|
||||
bodhi-password = "{{ monitor_gating_packagerbot_pwd_stg }}"
|
||||
|
||||
_env = "stg"
|
||||
_ci_env = "stage"
|
||||
fas_username = "packagerbot"
|
||||
namespace = "rpms"
|
||||
name_single = "dummy-test-package-gloster"
|
||||
name_multi_1 = "dummy-test-package-crested"
|
||||
name_multi_2 = "dummy-test-package-rubino"
|
||||
branch = "master"
|
||||
pagure_token = "{{ monitor_gating_pagure_token_stg }}"
|
||||
|
||||
{% else %}
|
||||
fedpkg = "fedpkg"
|
||||
resultsdb = "https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/results"
|
||||
resultsdb_rdu = "http://resultsdb.ci.centos.org/resultsdb_api/api/v2.0/results"
|
||||
datagrepper = "https://apps.fedoraproject.org/datagrepper/raw"
|
||||
pagure_dist_git = "https://src.fedoraproject.org/"
|
||||
distgit_host = "pkgs.fedoraproject.org"
|
||||
koji_hub = "https://koji.fedoraproject.org/kojihub"
|
||||
bodhi = "https://bodhi.fedoraproject.org"
|
||||
bodhi-cli = "bodhi"
|
||||
bodhi-user = "packagerbot"
|
||||
bodhi-password = "{{ monitor_gating_packagerbot_pwd_prod }}"
|
||||
|
||||
_env = "prod"
|
||||
_ci_env = "prod"
|
||||
fas_username = "packagerbot"
|
||||
namespace = "rpms"
|
||||
name_single = "dummy-test-package-gloster"
|
||||
name_multi_1 = "dummy-test-package-crested"
|
||||
name_multi_2 = "dummy-test-package-rubino"
|
||||
branch = "master"
|
||||
pagure_token = "{{ monitor_gating_pagure_token_prod }}"
|
||||
{% endif %}
|
8
roles/openshift-apps/monitor_gating/templates/runner.cfg
Normal file
8
roles/openshift-apps/monitor_gating/templates/runner.cfg
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Time between two runs in second
|
||||
delay = 3600
|
||||
|
||||
# CLI arguments to give to the script testing the single build gating workflow
|
||||
workflow_single_gating_args = "--conf /conf/monitor_gating.cfg --auto-update --no-pr"
|
||||
|
||||
# CLI arguments to give to the script testing the multi builds gating workflow
|
||||
workflow_multi_gating_args = "--conf /conf/monitor_gating.cfg
|
10
roles/openshift-apps/monitor_gating/templates/secret.yml
Normal file
10
roles/openshift-apps/monitor_gating/templates/secret.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% macro load_file(filename) %}{% include filename %}{%- endmacro -%}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: monitor_gating-secret
|
||||
labels:
|
||||
app: monitor_gating
|
||||
stringData:
|
||||
monitor_gating.cfg: |-
|
||||
{{ load_file('monitor_gating.cfg') | indent }}
|
Loading…
Add table
Add a link
Reference in a new issue