diff --git a/playbooks/openshift-apps/discourse2fedmsg.yml b/playbooks/openshift-apps/discourse2fedmsg.yml new file mode 100644 index 0000000000..ca605b3764 --- /dev/null +++ b/playbooks/openshift-apps/discourse2fedmsg.yml @@ -0,0 +1,48 @@ +- name: make the app be real + hosts: os-masters-stg[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: discourse2fedmsg + description: discourse2fedmsg + appowners: + - puiterwijk + - role: openshift/object + app: discourse2fedmsg + file: imagestream.yml + objectname: imagestream.yml + - role: openshift/object + app: discourse2fedmsg + file: buildconfig.yml + objectname: buildconfig.yml + + - role: openshift/start-build + app: discourse2fedmsg + buildname: discourse2fedmsg-build + + - role: openshift/object + app: discourse2fedmsg + file: service.yml + objectname: service.yml + + - role: openshift/route + app: discourse2fedmsg + routename: discourse2fedmsg + serviceport: 8080-tcp + servicename: discourse2fedmsg + + - role: openshift/object + app: discourse2fedmsg + template: deploymentconfig.yml + objectname: deploymentconfig.yml + + - role: openshift/rollout + app: discourse2fedmsg + dcname: discourse2fedmsg diff --git a/roles/openshift-apps/discourse2fedmsg/files/buildconfig.yml b/roles/openshift-apps/discourse2fedmsg/files/buildconfig.yml new file mode 100644 index 0000000000..7dd4c8ea38 --- /dev/null +++ b/roles/openshift-apps/discourse2fedmsg/files/buildconfig.yml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: BuildConfig +metadata: + name: discourse2fedmsg-build + labels: + environment: "discourse2fedmsg" +spec: + output: + to: + kind: ImageStreamTag + name: discourse2fedmsg:latest + source: + type: Git + git: + uri: https://pagure.io/discourse2fedmsg.git + strategy: + type: Source + sourceStrategy: + from: + kind: ImageStreamTag + name: python-33-rhel7:latest + triggers: + - type: ConfigChange + - type: ImageChange diff --git a/roles/openshift-apps/discourse2fedmsg/files/imagestream.yml b/roles/openshift-apps/discourse2fedmsg/files/imagestream.yml new file mode 100644 index 0000000000..2f944e1c8b --- /dev/null +++ b/roles/openshift-apps/discourse2fedmsg/files/imagestream.yml @@ -0,0 +1,28 @@ +--- +apiVersion: v1 +kind: ImageStream +metadata: + name: discourse2fedmsg +spec: + lookupPolicy: + local: false +status: + dockerImageRepository: "" +--- +apiVersion: v1 +kind: ImageStream +metadata: + name: python-33-rhel7 +spec: + lookupPolicy: + local: false + tags: + - from: + kind: DockerImage + name: registry.access.redhat.com/openshift3/python-33-rhel7 + importPolicy: {} + name: latest + referencePolicy: + type: Source +status: + dockerImageRepository: "" diff --git a/roles/openshift-apps/discourse2fedmsg/files/service.yml b/roles/openshift-apps/discourse2fedmsg/files/service.yml new file mode 100644 index 0000000000..ea7ad9b567 --- /dev/null +++ b/roles/openshift-apps/discourse2fedmsg/files/service.yml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: discourse2fedmsg + name: discourse2fedmsg +spec: + ports: + - name: 8080-tcp + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app: discourse2fedmsg + deploymentconfig: discourse2fedmsg + diff --git a/roles/openshift-apps/discourse2fedmsg/templates/deploymentconfig.yml b/roles/openshift-apps/discourse2fedmsg/templates/deploymentconfig.yml new file mode 100644 index 0000000000..1709db4d30 --- /dev/null +++ b/roles/openshift-apps/discourse2fedmsg/templates/deploymentconfig.yml @@ -0,0 +1,50 @@ +--- +apiVersion: v1 +kind: DeploymentConfig +metadata: + labels: + app: discourse2fedmsg + service: discourse2fedmsg + name: discourse2fedmsg +spec: + replicas: 2 + selector: + app: discourse2fedmsg + deploymentconfig: discourse2fedmsg + strategy: + resources: {} + template: + metadata: + labels: + app: discourse2fedmsg + deploymentconfig: discourse2fedmsg + spec: + containers: + - image: discourse2fedmsg:latest + name: discourse2fedmsg + ports: + - containerPort: 8080 + protocol: TCP + 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: + - discourse2fedmsg + from: + kind: ImageStreamTag + name: discourse2fedmsg:latest