-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds more pacakge and system dependencies to the Dockerfile.test as well as running coverage and domains unit tests as entrypoint. This is used to test the image before uploading to quay.io. Signed-off-by: Francisco Trivino <[email protected]>
- Loading branch information
Showing
3 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# Podmanfile for building bridge image in development mode, including Swagger. | ||
|
||
FROM registry.fedoraproject.org/fedora:38 | ||
ENV TZ=Europe/Madrid | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/freeipa/ipa-tuura | ||
LABEL org.opencontainers.image.description="IPA-tuura Container" | ||
LABEL org.opencontainers.image.description="Fedora Bridge Development Image" | ||
|
||
# Install dependencies | ||
# Install system dependencies | ||
RUN dnf -y update && dnf -y install \ | ||
dbus-daemon \ | ||
dbus-devel \ | ||
|
@@ -28,7 +30,51 @@ RUN dnf -y update && dnf -y install \ | |
unzip \ | ||
&& dnf clean all | ||
|
||
COPY . ipa-tuura | ||
WORKDIR /ipa-tuura | ||
RUN pip install -r src/install/requirements.txt | ||
RUN python3 src/ipa-tuura/manage.py test | ||
# Install bridge dependencies | ||
RUN dnf -y update && dnf -y install \ | ||
openldap-clients \ | ||
sssd \ | ||
sssd-ldap \ | ||
sssd-ipa \ | ||
realmd \ | ||
freeipa-client \ | ||
oddjob-mkhomedir \ | ||
&& dnf clean all | ||
|
||
# Copy the source code | ||
RUN mkdir /www | ||
COPY . /www/ipa-tuura | ||
|
||
# Install project dependencies | ||
RUN pip install -r /www/ipa-tuura/src/install/requirements.txt | ||
|
||
# packaging up model changes | ||
WORKDIR /www/ipa-tuura/src/ipa-tuura/ | ||
RUN python3 manage.py makemigrations | ||
RUN python3 manage.py migrate | ||
|
||
# ENV | ||
ENV DJANGO_SUPERUSER_PASSWORD Secret123 | ||
ENV DJANGO_SUPERUSER_USERNAME scim | ||
ENV DJANGO_SUPERUSER_EMAIL [email protected] | ||
|
||
# Create user | ||
RUN python3 manage.py createsuperuser --scim_username scim --noinput | ||
|
||
# Configuration | ||
RUN sed -i 's/ALLOWED_HOSTS = \[\]/ALLOWED_HOSTS = \['"'*'"'\]/g' root/settings.py | ||
|
||
# Install Unit Test Dependencies | ||
RUN pip install factory_boy coverage | ||
|
||
# Create and enable bridge service in devel mode (via manage.py HTTP) | ||
COPY bridge-devel.service /etc/systemd/system/bridge.service | ||
RUN systemctl enable bridge | ||
|
||
CMD [ "/sbin/init" ] | ||
|
||
# WA | ||
#RUN hostnamectl set-hostname bridge.ipa.test | ||
|
||
# Run the unit tests for the integration domains app | ||
# RUN coverage run manage.py test domains -v 2 && coverage report && coverage html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=SCIMv2 Bridge Server | ||
After=network.target | ||
|
||
[Service] | ||
Type=idle | ||
WorkingDirectory=/www/ipa-tuura/src/ipa-tuura/ | ||
ExecStart=/usr/bin/python3 /www/ipa-tuura/src/ipa-tuura/manage.py runserver 0.0.0.0:8000 | ||
TimeoutStartSec=600 | ||
TimeoutStopSec=600 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |