ansible/roles/openshift-apps/release-monitoring/templates/buildconfig.yml.j2
Ryan Lerch 1a749f67cf release-monitoring - rename yml templates to .j2
Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-14 08:37:31 +10:00

109 lines
3.4 KiB
Django/Jinja

---
apiVersion: build.openshift.io/v1
items:
- apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
labels:
build: release-monitoring-web-build
name: release-monitoring-web-build
spec:
runPolicy: Serial
source:
dockerfile: |-
FROM fedora:40
LABEL \
name="release-monitoring-web" \
vendor="Fedora Infrastructure" \
license="MIT"
RUN dnf install -y \
git \
httpd \
graphviz \
fedora-messaging \
npm \
poetry \
python3-alembic \
python3-authlib \
python3-beautifulsoup4 \
python3-arrow \
python3-dateutil \
python3-defusedxml \
python3-flask-login \
python3-flask-wtf \
python3-jinja2 \
python3-mod_wsgi \
python3-ordered-set \
python3-pip \
python3-psycopg2 \
python3-semver \
python3-sqlalchemy \
python3-sqlalchemy_schemadisplay \
python3-sseclient \
python3-straight-plugin \
python3-toml \
python3-wtforms && \
dnf autoremove -y && \
dnf clean all -y
# This is needed because the version 1.7.0 currently available in Fedora
# doesn't work with sphinx 5+ and fails when building documentation
RUN pip-3 install sphinxcontrib-httpdomain
RUN git clone https://github.com/fedora-infra/anitya.git && \
pushd anitya && \
{% if env == 'staging' %}
git checkout staging && \
{% else %}
git checkout production && \
{% endif %}
poetry build && \
pip-3 install dist/*.whl && \
pushd docs && \
mkdir -p images && \
python3 generate_db_schema && \
sphinx-build -b html . _build/html && \
mkdir -p ../anitya/static/docs/ && \
cp -r _build/html/* ../anitya/static/docs/ && \
popd && \
# Uninstall the existing anitya installation first
pip-3 uninstall -y anitya && \
# Install javascript dependencies
pushd anitya/static && \
npm install && \
popd && \
poetry build && \
pip-3 install dist/*.whl && \
popd && \
rm -rf anitya
RUN mkdir /httpdir
RUN chmod 777 /httpdir
EXPOSE 8080
EXPOSE 9940
type: Dockerfile
git:
uri: https://github.com/fedora-infra/anitya.git
{% if env == 'staging' %}
ref: staging
{% else %}
ref: production
{% endif %}
strategy:
type: Docker
dockerStrategy:
noCache: true
output:
to:
kind: ImageStreamTag
name: release-monitoring-web:latest
triggers:
{% if stg_anitya_github_secret is defined and env == 'staging' %}
- type: GitHub
github:
secret: "{{ stg_anitya_github_secret }}"
{% elif anitya_github_secret is defined and env == 'production' %}
- type: GitHub
github:
secret: "{{ anitya_github_secret }}"
{% endif %}
- type: ImageChange
kind: List
metadata: {}