New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a dockerfile for CI to run in #193
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM debian:buster-slim | ||
|
||
RUN set -ex \ | ||
&& apt-get update \ | ||
&& apt-get install -y \ | ||
build-essential \ | ||
python2.7-dev \ | ||
libffi-dev \ | ||
sqlite3 \ | ||
python-pip \ | ||
libssl-dev \ | ||
python-virtualenv \ | ||
libxslt1-dev | ||
|
||
# Install dependencies | ||
RUN pip install https://github.com/matrix-org/sydent/tarball/master \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You probably want to run this last in the run script. pip and setuptools can also break when you go down this path as I found while trying to build this out myself here email templates wont translate over from a Running as root is also incredibly dangerous as you can break out of the container |
||
&& pip install --upgrade pip \ | ||
&& pip install --upgrade setuptools | ||
|
||
# Copy in and run the start script | ||
COPY ./sydent-ci.sh /sydent-ci.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Docker | ||
|
||
Currently only a single, official docker container | ||
(`matrixdotorg/sydent-build`) is provided. It is intended to set up a running | ||
environment for testing Sydent and nothing more. You can find it [on Docker | ||
hub](https://hub.docker.com/r/matrixdotorg/sydent-build). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Install any new dependencies | ||
pip install -e . | ||
|
||
# Start Sydent and run for 5s | ||
timeout 5s python -m sydent.sydent | ||
|
||
# Check that it started up correctly | ||
if [ $? -eq 124 ]; then | ||
# Timeout got it, so it must've been running correctly | ||
echo "Sydent startup up successfully" | ||
exit 0 | ||
else | ||
# Sydent exited before the timeout. Something went wrong | ||
echo "Sydent failed to start" | ||
echo 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One usually builds from the checked out source, rather than just always fetching master.