From 66ebcb1ea28a74ecc296b2f27fa69a503082a3e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Thu, 17 Sep 2020 09:50:58 +0200 Subject: [PATCH] Rebase on F32 and add deps that are not yet in Fedora but will be /soon/. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- .../ipsilon/templates/Dockerfile | 52 +++++++++++++++++++ .../ipsilon/templates/buildconfig.yml | 49 ++--------------- 2 files changed, 55 insertions(+), 46 deletions(-) create mode 100644 roles/openshift-apps/ipsilon/templates/Dockerfile diff --git a/roles/openshift-apps/ipsilon/templates/Dockerfile b/roles/openshift-apps/ipsilon/templates/Dockerfile new file mode 100644 index 0000000000..4744bce45f --- /dev/null +++ b/roles/openshift-apps/ipsilon/templates/Dockerfile @@ -0,0 +1,52 @@ +FROM fedora:32 +RUN curl -o /etc/yum.repos.d/infra-tags.repo https://infrastructure.fedoraproject.org/infra/ansible/files/common/fedora-infra-tags.repo +env == "staging" %} +RUN curl -o /etc/yum.repos.d/infra-tags-stg.repo https://infrastructure.fedoraproject.org/infra/ansible/files/common/fedora-infra-tags-stg.repo +RUN curl -o /etc/yum.repos.d/fedora-updates-testing.repo https://src.fedoraproject.org/rpms/fedora-repos/raw/master/f/fedora-updates-testing.repo +if %} +RUN dnf install -y \ +env == "staging" %} + --enablerepo=updates-testing \ +if %} + ipsilon \ + ipsilon-openid \ + ipsilon-saml2 \ + ipsilon-persona \ + ipsilon-authgssapi \ + ipsilon-authldap \ + ipsilon-openidc \ + ipsilon-theme-Fedora \ + mod_auth_openidc \ + python-psycopg2 \ + python-setuptools \ + python-jinja2 \ + httpd \ + python3-mod_wsgi \ + #python3-fasjson-client \ + git + +# Fedora specific stuff +RUN cd /tmp && \ + git clone --branch {{ env }} https://pagure.io/fedora-infra/ipsilon-fedora.git && \ + cd ipsilon-fedora && \ + ./install.sh + +# Cleanup +RUN dnf remove -y git && rm -rf /tmp/ipsilon-fedora + +# Set up krb5 +RUN rm -f /etc/krb5.conf && ln -sf /etc/ipsilon/krb5.conf /etc/krb5.conf +# Set up LDAP +RUN rm -f /etc/openldap/ldap.conf && ln -sf /etc/ipa/ldap.conf /etc/openldap/ldap.conf + +RUN ln -s /etc/ipsilon/ipsilon.conf /var/lib/ipsilon/ipsilon.conf + +# Install some more deps that are not yet in Fedora nor in the infra repo. This is very temporary. (added in 2020) +RUN dnf install -y \ + https://abompard.fedorapeople.org/aaa/python3-jsonref-0.2-1.fc32.noarch.rpm \ + https://abompard.fedorapeople.org/aaa/python3-bravado-core-5.17.0-1.fc32.noarch.rpm \ + https://abompard.fedorapeople.org/aaa/python3-bravado-10.6.2-1.fc32.noarch.rpm \ + https://abompard.fedorapeople.org/aaa/python3-fasjson-client-0.0.3-1.fc32.noarch.rpm + +EXPOSE 8080 +ENTRYPOINT bash /etc/ipsilon/start.sh diff --git a/roles/openshift-apps/ipsilon/templates/buildconfig.yml b/roles/openshift-apps/ipsilon/templates/buildconfig.yml index 92f560f328..b8b37f17e1 100644 --- a/roles/openshift-apps/ipsilon/templates/buildconfig.yml +++ b/roles/openshift-apps/ipsilon/templates/buildconfig.yml @@ -1,3 +1,4 @@ +{% macro load_file(filename) %}{% include filename %}{%- endmacro -%} apiVersion: v1 kind: BuildConfig metadata: @@ -7,53 +8,9 @@ metadata: spec: runPolicy: Serial source: - dockerfile: |- - FROM fedora:31 - RUN curl -o /etc/yum.repos.d/infra-tags.repo https://infrastructure.fedoraproject.org/infra/ansible/files/common/fedora-infra-tags.repo -{% if env == "staging" %} - RUN curl -o /etc/yum.repos.d/infra-tags-stg.repo https://infrastructure.fedoraproject.org/infra/ansible/files/common/fedora-infra-tags-stg.repo - RUN curl -o /etc/yum.repos.d/fedora-updates-testing.repo https://src.fedoraproject.org/rpms/fedora-repos/raw/master/f/fedora-updates-testing.repo -{% endif %} - RUN dnf install -y \ -{% if env == "staging" %} - --enablerepo=updates-testing \ -{% endif %} - ipsilon \ - ipsilon-openid \ - ipsilon-saml2 \ - ipsilon-persona \ - ipsilon-authgssapi \ - ipsilon-authldap \ - ipsilon-openidc \ - ipsilon-theme-Fedora \ - mod_auth_openidc \ - python-psycopg2 \ - python-setuptools \ - python-jinja2 \ - httpd \ - python3-mod_wsgi \ - python3-fasjson-client \ - git - - # Fedora specific stuff - RUN cd /tmp && \ - git clone --branch {{ env }} https://pagure.io/fedora-infra/ipsilon-fedora.git && \ - cd ipsilon-fedora && \ - ./install.sh - - # Cleanup - RUN dnf remove -y git && rm -rf /tmp/ipsilon-fedora - - # Set up krb5 - RUN rm -f /etc/krb5.conf && ln -sf /etc/ipsilon/krb5.conf /etc/krb5.conf - # Set up LDAP - RUN rm -f /etc/openldap/ldap.conf && ln -sf /etc/ipa/ldap.conf /etc/openldap/ldap.conf - - RUN ln -s /etc/ipsilon/ipsilon.conf /var/lib/ipsilon/ipsilon.conf - - EXPOSE 8080 - ENTRYPOINT bash /etc/ipsilon/start.sh type: Dockerfile + dockerfile: |- + {{ load_file('Dockerfile') | indent(6) }} strategy: type: Docker output: