Adjust transstats for testing more in staging.

This commit is contained in:
Kevin Fenzi 2018-07-03 18:11:36 +00:00
parent 88be86952d
commit 8c586a0a54
4 changed files with 48 additions and 21 deletions

View file

@ -7,29 +7,54 @@ metadata:
spec:
runPolicy: Serial
source:
git:
ref: master
uri: https://github.com/transtats/transtats.git
secrets: null
type: Git
dockerfile: |-
FROM registry.fedoraproject.org/fedora:latest
USER root
RUN useradd -ms /bin/bash tsuser
RUN dnf -y update && \
dnf -y install git make cpio koji patch && \
dnf clean all
RUN mkdir /workspace
ENV PYTHONUNBUFFERED 1
WORKDIR /workspace
RUN git clone -b master https://github.com/transtats/transtats.git .
RUN pip3 install -r /workspace/requirements/base.txt
RUN cp deploy/docker-compose/transtats/launch.sh /usr/bin/transtats.sh
RUN cp deploy/docker-compose/transtats/wait-for-it.sh /usr/bin/wait-for-it.sh
RUN mkdir staticfiles
RUN chmod g+w transtats/logs dashboard/sandbox staticfiles
RUN chown -R tsuser /workspace
EXPOSE 8080
USER tsuser
ENTRYPOINT ["/usr/bin/transtats.sh"]
type: Dockerfile
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: python:3.5
namespace: openshift
dockerStrategy:
env:
- name: UPGRADE_PIP_TO_LATEST
value: "true"
- name: PIP_INDEX_URL
- name: TS_AUTH_SYSTEM
value: fedora
valueFrom:
secretKeyRef:
name: transtats-secret
key: ts-auth-system
- name: ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: transtats-secret
key: admin-password
- name: OIDC_RP_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: transtats-secret
key: oidc-client-secret
type: Source
- name: DJANGO_SECRET_KEY
valueFrom:
secretKeyRef:
name: transtats-secret
key: django-secret-key
type: Docker
output:
to:
kind: ImageStreamTag

View file

@ -26,8 +26,11 @@ spec:
- name: DATABASE_ENGINE
value: postgresql
- name: DATABASE_NAME
value: transtats
- name: POSTGRES_SERVICE_HOST
valueFrom:
secretKeyRef:
name: transtats-secret
key: database-name
- name: DATABASE_HOST
valueFrom:
secretKeyRef:
name: transtats-secret
@ -42,11 +45,11 @@ spec:
secretKeyRef:
name: transtats-secret
key: database-password
- name: DJANGO_SECRET_KEY
- name: INITIAL_DATA_FILE_PATH
valueFrom:
secretKeyRef:
name: transtats-secret
key: django-secret-key
key: initial-data-file-path
readinessProbe:
timeoutSeconds: 1
initialDelaySeconds: 5

View file

@ -5,8 +5,3 @@ metadata:
spec:
tags:
- name: latest
---
apiVersion: v1
kind: ImageStream
metadata:
name: transtats

View file

@ -6,8 +6,12 @@ metadata:
app: "transtats"
stringData:
{% if env == 'staging' %}
ts-auth-system: "fedora"
admin-password: "{{transtats_stg_admin_password}}"
django-secret-key: "{{transtats_stg_django_secret_key}}"
database-name: "transtats"
database-password: "{{transtats_stg_database_password}}"
initial-data-file-path: "/workspace/deploy/docker-compose/transtats/initialdata.yaml"
oidc-client-secret: ""
database-host: db01.stg.phx2.fedoraproject.org
database-user: transtats