Skip to content

Commit

Permalink
Merge pull request #562 from ejplatform/develop
Browse files Browse the repository at this point in the history
Release Ada Lovelace
  • Loading branch information
ricardopoppi authored Oct 12, 2018
2 parents bc26289 + 0d16a35 commit ca0c46f
Show file tree
Hide file tree
Showing 215 changed files with 4,880 additions and 4,948 deletions.
3 changes: 2 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[run]
include = src/*
omit = *migrations*, *tests*
omit = *migrations*, *tests*, *.html*
branch = True
plugins =
django_coverage_plugin
Expand Down Expand Up @@ -28,6 +28,7 @@ exclude_lines =
while 0:
while False:
ignore_errors = True
show_missing = True


[paths]
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
================================
CHANGELOG of EJPlatform releases
================================

Here you can follow all the fixes and new features on every EJPlatform release.

ADA LOVELACE release
====================

* Date: October 11, 2018
* Features
- Participate on conversations with votes and comments
- Add conversation to favorites
- Track your comments on conversations viewing how they perform with other users
- Create new conversations and organize them on boards
- Accept or reject comments with reasoning
- Define stereotypes on conversations to read reports of opinion groups
- Fill your profile information with a personalized picture
- Read basic documentation about how to use EJPlatform
47 changes: 34 additions & 13 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
Bruno Martin
Caio Almeida
Fábio Macêdo Mendes <[email protected]>
Henrique Parra
Jonathan Moraes
Laury Bueno
Leandro dos Santos
Luan Guimarães
Marco William
Pablo da Silva
Ricardo Poppi
Rodrigo Oliveira
Tiago Fassoni
Bruno Martin (/hacklab)
Caio Almeida (Lappis/UnB)
Fábio Macêdo Mendes (Lappis/UnB)
Henrique Parra (Instituto Cidade Democrática)
Jonathan Moraes (Lappis/UnB)
Laury Bueno (/hacklab)
Leandro dos Santos (Lappis/UnB)
Luan Guimarães (Lappis/UnB)
Marco William (FGA/UnB)
Pablo da Silva (Lappis/UnB)
Ricardo Poppi (Instituto Cidade Democrática + Lappis/UnB)
Rodrigo Oliveira (Lappis/UnB)
Tiago Fassoni (/hacklab)
Bruna Nayara (Lappis/UnB)
Fabíola Malta (Lappis/UnB)
Heloise Cullen (Lappis/UnB)
Rafael Makaha (Lappis/UnB)
Matheus Richard (Lappis/UnB)
Valessio Brito (Lappis/UnB)
David Carlos (Pencil Labs)
Daniel Henrique (Pencil Labs)
Carla Rocha (Lappis/UnB)
Artur Jhan (Pencil Labs)
Artur Diniz (Lappis/UnB)
Lucas Malta (Lappis/UnB)
Áulus Diniz (Pencil Labs)
Gardênia Lima (Lappis/UnB)
Marcela Sá (Lappis/UnB)
Dayanne Fernandes (Lappis/UnB)
Luiza Peixe (Lappis/UnB)
Leonardo Gomes (Lappis/UnB)
Guilherme Lacerda (Lappis/UnB)
Gabriela Alvez (Lappis/UnB)
Alexandre Augusto (Lappis/UnB)
8 changes: 6 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _Invoke: http://www.pyinvoke.org/
Local development (virtualenv)
------------------------------

EJ platform **requires** you to `Prepare environment`_ + with the
EJ platform **requires** you to _`Prepare environment` + with the
development headers. Please install those packages using your distro package
manager. This is a list of packages that you should have installed locally:

Expand All @@ -64,7 +64,7 @@ command.
Running it
~~~~~~~~~~

Unless you prefer to type long django management commands, use IThere are many other nvoke_ to start
Unless you prefer to type long django management commands, use Invoke_ to start
the dev server::

$ inv run
Expand Down Expand Up @@ -108,6 +108,10 @@ development::
This creates a few conversations with comments and votes plus several users and
an admin:admin <[email protected]> user.

Documentation
~~~~~~~~~~~~~

Documentation can be updated with `$ sphinx-build docs build/docs` and will be available at http://localhost:8000/docs.

Using docker
------------
Expand Down
2 changes: 1 addition & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ if [ -z $VIRTUAL_ENV ]; then
exit
fi
echo "Installing chromedriver..."
sh etc/scripts/chromedriver.sh
# sh etc/scripts/chromedriver.sh
pip install invoke
inv configure --silent
7 changes: 7 additions & 0 deletions digitaloceanssh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sshpass -p $1 ssh -o StrictHostKeyChecking=no root@$2 <<-'ENDSSH'
cd ej-server/docker/
docker-compose -f docker-compose.deploy.yml down
docker rmi $(docker images -q) -f
docker network prune -f
docker-compose -f docker-compose.deploy.yml up -d
ENDSSH
118 changes: 20 additions & 98 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,112 +1,34 @@
#
# Build static assets
#
FROM ejplatform/tools:latest as assets
FROM ejplatform/local:latest


# Compile translations
COPY ./etc/scripts/compilemessages.py /usr/bin/compilemessages
COPY ./locale/ /app/locale/
WORKDIR /app
RUN chmod +x /usr/bin/compilemessages \
&& compilemessages

# Build Sass
ARG THEME=default
COPY ./lib/scss /app/lib/scss
COPY ./lib/themes /app/lib/themes
COPY ./tasks.py /app/tasks.py
RUN mkdir -p /app/lib/build/css/ \
&& inv -e sass --theme=${THEME}

# Build javascript assets (TODO)
RUN inv -e js


#
# Create python packages
#
FROM ejplatform/python:buster as pymodules

# Create django-boogie package
WORKDIR /app
ADD https://github.com/fabiommendes/django-boogie/archive/master.zip /app/boogie.zip
RUN unzip boogie.zip \
&& cd django-boogie-master \
&& python setup.py sdist \
&& cd dist \
&& mv django-boogie* /app/boogie.tar.gz \
&& echo "INSTALLED DJANGO-BOOGIE"

# Create hyperpython package
ADD https://github.com/fabiommendes/hyperpython/archive/master.zip /app/hyperpython.zip
RUN unzip hyperpython.zip \
&& cd hyperpython-master \
&& python setup.py sdist \
&& cd dist \
&& mv hyperpython* /app/hyperpython.tar.gz \
&& echo "INSTALLED HYPERPYTHON"


#
# Final image
#
FROM ejplatform/python:deploy

# Set theme and environment variables
# Configure environment
ENV DJANGO_SETTINGS_MODULE=ej.settings
ENV DJANGO_ENVIRONMENT=production
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH="/app/src/:$PYTHONPATH"
WORKDIR /app

# Copy requirements and update packages
# Most of the time, this will not install anything new.
COPY ./etc/requirements/ /etc/requirements/
RUN pip install -r /etc/requirements/production.txt

# Copy files
COPY ./.coveragerc /app/.coveragerc
COPY ./lib/ /app/lib/
COPY ./locale/ /app/locale/
COPY ./manage.py /app/manage.py
COPY ./src/ /app/src/

# Copy django boogie
COPY --from=pymodules /app/*.tar.gz /app/
RUN pip install /app/*.tar.gz \
&& rm /app/*.tar.gz
# Copy necessary files
COPY ./etc/requirements/ /app/etc/requirements/
COPY ./etc/scripts/ /app/etc/scripts/
COPY ./tasks.py /app/tasks.py

# Set enviroment variables
ARG COUNTRY=brasil
ARG HOSTNAME=localhost
ARG THEME=default
ENV COUNTRY=${COUNTRY}
ENV EJ_THEME=${THEME}
ENV HOSTNAME=${HOSTNAME}
# Install dependencies
RUN inv update-deps --all --vendor /vendor

# Copy build-time assets: CSS, JS, i18n
COPY --from=assets /app/lib/build/ /app/lib/build/
COPY --from=assets /app/locale/ /app/locale/
# Move vendorized apps away from /app
RUN mv /app/local/vendor/ /vendor/ \
&& echo "RELOCATED PYTHON MODULES"

# Prepare deploy assets
COPY ./tasks.py /app/tasks.py
RUN mkdir -p local/logs local/static/ local/media/ local/db/ \
&& python manage.py collectstatic --noinput \
&& echo "COLLECTED STATIC ASSETS"
ARG UID=1000
ARG GID=1000

# Create django user
RUN groupadd -r django \
&& useradd -r -g django django \
&& chown -R django:django /app
USER django

# Save commit info
ARG COMMIT_TITLE=none
ARG COMMIT_HASH=none
RUN echo "${COMMIT_HASH}: ${COMMIT_TITLE}" > commit.txt

RUN groupadd -r django -g ${GID} \
&& useradd -r -g django django -u ${UID} \
&& chown -R django:django /app \
&& chown -R django:django /vendor \
&& echo "DJANGO USER CREATED"

# Entry point defaults to inv run
EXPOSE 5000
EXPOSE 8000
ENTRYPOINT ["inv"]
CMD ["bash"]
34 changes: 0 additions & 34 deletions docker/Dockerfile-dev

This file was deleted.

87 changes: 87 additions & 0 deletions docker/Dockerfile.deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#
# Build static assets
#
FROM ejplatform/tools:latest as assets


# Compile translations
COPY ./etc/scripts/compilemessages.py /usr/bin/compilemessages
COPY ./locale/ /app/locale/
WORKDIR /app
RUN chmod +x /usr/bin/compilemessages \
&& compilemessages


# Build Sass
ARG THEME=default
COPY ./lib/scss /app/lib/scss
COPY ./lib/themes /app/lib/themes
COPY ./tasks.py /app/tasks.py
RUN mkdir -p /app/lib/build/css/ \
&& inv -e sass --theme=${THEME}

# Build javascript assets (TODO)
RUN inv -e js

#
# Final image
#
FROM ejplatform/python:deploy


# Set theme and environment variables
ENV DJANGO_SETTINGS_MODULE=ej.settings
ENV DJANGO_ENVIRONMENT=production
ENV PYTHONPATH="/app/src/:$PYTHONPATH"
WORKDIR /app


# Copy requirements and update packages
# Most of the time, this will not install anything new.
COPY ./etc/requirements/ /etc/requirements/
RUN pip install -r /etc/requirements/production.txt

# Copy files
COPY ./.coveragerc /app/.coveragerc
COPY ./lib/ /app/lib/
COPY ./locale/ /app/locale/
COPY ./manage.py /app/manage.py
COPY ./src/ /app/src/
COPY ./docs/ /app/docs

RUN sphinx-build docs/ /app/build/docs

# Set enviroment variables
ARG COUNTRY=brasil
ARG HOSTNAME=localhost
ARG THEME=default
ENV COUNTRY=${COUNTRY}
ENV EJ_THEME=${THEME}
ENV HOSTNAME=${HOSTNAME}

# Copy build-time assets: CSS, JS, i18n
COPY --from=assets /app/lib/build/ /app/lib/build/
COPY --from=assets /app/locale/ /app/locale/

# Prepare deploy assets
COPY ./tasks.py /app/tasks.py
RUN mkdir -p local/logs local/static/ local/media/ local/db/ \
&& python manage.py collectstatic --noinput \
&& echo "COLLECTED STATIC ASSETS"

# Create django user
RUN groupadd -r django \
&& useradd -r -g django django \
&& chown -R django:django /app
USER django

# Save commit info
ARG COMMIT_TITLE=none
ARG COMMIT_HASH=none
RUN echo "${COMMIT_HASH}: ${COMMIT_TITLE}" > commit.txt


# Entry point defaults to inv run
EXPOSE 8000
ENTRYPOINT ["inv"]
CMD ["bash"]
10 changes: 10 additions & 0 deletions docker/Dockerfile.waitmongo
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM debian:jessie

LABEL Description="This dockerfile checks if the mongodb server is up."

ADD initial_script.js /initial_script.js
ADD wait-for-mongodb.sh /wait-for-mongodb.sh

RUN apt-get update && apt-get install -y sudo curl mongodb

ENTRYPOINT ["/wait-for-mongodb.sh"]
Loading

0 comments on commit ca0c46f

Please sign in to comment.