testdays: start the playbook and role to deploy this app in openshift
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
parent
8a13932c66
commit
80364165e6
5 changed files with 165 additions and 0 deletions
44
playbooks/openshift-apps/testdays.yml
Normal file
44
playbooks/openshift-apps/testdays.yml
Normal file
|
@ -0,0 +1,44 @@
|
|||
- name: make the app be real
|
||||
hosts: os_masters_stg[0] #:os_masters[0]:
|
||||
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: testdays
|
||||
description: The Fedora QE testdays application
|
||||
appowners:
|
||||
- pingou
|
||||
- frantisekz
|
||||
tags:
|
||||
- appowners
|
||||
|
||||
- role: openshift/object
|
||||
app: testdays
|
||||
template: buildconfig.yml
|
||||
objectname: buildconfig.yml
|
||||
|
||||
- role: openshift/object
|
||||
app: testdays
|
||||
template: deploymentconfig.yml
|
||||
objectname: deploymentconfig.yml
|
||||
|
||||
- role: openshift/object
|
||||
app: testdays
|
||||
template: imagestream.yml
|
||||
objectname: imagestream.yml
|
||||
|
||||
- role: openshift/object
|
||||
app: testdays
|
||||
file: service.yml
|
||||
objectname: service.yml
|
||||
|
||||
- role: openshift/start-build
|
||||
app: testdays
|
||||
buildname: testdays-build
|
||||
objectname: testdays-build
|
15
roles/openshift-apps/testdays/files/service.yml
Normal file
15
roles/openshift-apps/testdays/files/service.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: testdays
|
||||
name: testdays
|
||||
spec:
|
||||
ports:
|
||||
- name: 8080-tcp
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
selector:
|
||||
app: testdays
|
||||
deploymentconfig: testdays
|
30
roles/openshift-apps/testdays/templates/buildconfig.yml
Normal file
30
roles/openshift-apps/testdays/templates/buildconfig.yml
Normal file
|
@ -0,0 +1,30 @@
|
|||
apiVersion: v1
|
||||
kind: BuildConfig
|
||||
metadata:
|
||||
name: testdays-build
|
||||
labels:
|
||||
environment: "testdays"
|
||||
spec:
|
||||
output:
|
||||
to:
|
||||
kind: ImageStreamTag
|
||||
name: testdays:latest
|
||||
source:
|
||||
type: Git
|
||||
git:
|
||||
uri: https://pagure.io/fedora-qa/testdays-web.git
|
||||
{% if env == 'staging' %}
|
||||
ref: "develop"
|
||||
{% else %}
|
||||
ref: "production"
|
||||
{% endif %}
|
||||
strategy:
|
||||
type: Source
|
||||
sourceStrategy:
|
||||
from:
|
||||
kind: ImageStreamTag
|
||||
namespace: openshift
|
||||
name: python:3.6
|
||||
triggers:
|
||||
- type: ConfigChange
|
||||
- type: ImageChange
|
66
roles/openshift-apps/testdays/templates/deploymentconfig.yml
Normal file
66
roles/openshift-apps/testdays/templates/deploymentconfig.yml
Normal file
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: DeploymentConfig
|
||||
metadata:
|
||||
labels:
|
||||
app: testdays
|
||||
service: testdays
|
||||
name: testdays
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
app: testdays
|
||||
deploymentconfig: testdays
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: testdays
|
||||
deploymentconfig: testdays
|
||||
spec:
|
||||
containers:
|
||||
- name: testdays
|
||||
image: testdays:latest
|
||||
command: ["container_start.sh", "runserver"]
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
resources: {}
|
||||
env:
|
||||
- name: POSTGRESQL_USER
|
||||
value: "{{ }}"
|
||||
- name: POSTGRESQL_PASSWORD
|
||||
value: "{{ }}"
|
||||
- name: POSTGRESQL_DATABASE
|
||||
value: "{{ }}"
|
||||
- name: POSTGRESQL_SERVICE_HOST
|
||||
value: "{{ }}"
|
||||
- name: POSTGRESQL_SERVICE_PORT
|
||||
value: "{{ }}"
|
||||
- name: SECRET_KEY
|
||||
value: "{{ }}"
|
||||
- name: RESULTSDB_URL
|
||||
value: "https://taskotron.fedoraproject.org/resultsdb/results"
|
||||
readinessProbe:
|
||||
timeoutSeconds: 1
|
||||
initialDelaySeconds: 5
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8080
|
||||
livenessProbe:
|
||||
timeoutSeconds: 1
|
||||
initialDelaySeconds: 30
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8080
|
||||
|
||||
triggers:
|
||||
- type: ConfigChange
|
||||
- type: ImageChange
|
||||
imageChangeParams:
|
||||
automatic: true
|
||||
containerNames:
|
||||
- testdays
|
||||
from:
|
||||
kind: ImageStreamTag
|
||||
name: testdays:latest
|
10
roles/openshift-apps/testdays/templates/imagestream.yml
Normal file
10
roles/openshift-apps/testdays/templates/imagestream.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: ImageStream
|
||||
metadata:
|
||||
name: testdays
|
||||
spec:
|
||||
lookupPolicy:
|
||||
local: false
|
||||
status:
|
||||
dockerImageRepository: ""
|
Loading…
Add table
Add a link
Reference in a new issue