Skip to content

Commit

Permalink
Merge pull request #101 from luismayta/feature/#59
Browse files Browse the repository at this point in the history
Feature/#59
  • Loading branch information
luismayta authored Sep 28, 2017
2 parents b8d7f8c + d488bcb commit 069fd66
Show file tree
Hide file tree
Showing 29 changed files with 727 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
files = VERSION .bumpversion.cfg README.rst
files = VERSION .bumpversion.cfg README.rst docs/conf.py
commit = True
tag = False
current_version = 0.0.0
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ python-facebook-chatbot
.. contents:: Table of Contents:
:local:

Python Facebok Chatbot
Python Facebook Chatbot

Features
********
Expand Down
30 changes: 23 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
# Ventorystack: Docker Compose
# python-facebook-chatbot: Docker Compose
# https://docs.docker.com/compose/
#
# Usage: docker-compose up
version: '3'
services:
chatbot:

app:
ports:
- "80:8000"
restart: always
image: python:3.6.0
environment: &environment
- APP_NAME=python-facebook-chatbot
build:
context: .
dockerfile: docker/web/Dockerfile
image: python:2.7.9
ports:
- "5000:5000"
dockerfile: docker/app/Dockerfile
volumes:
- .:/app
- .:/usr/src
env_file:
- .env

docs:
restart: always
image: labpositiva/latex:3.6.1
build:
context: .
dockerfile: docker/docs/Dockerfile
volumes:
- .:/app
env_file:
- .env
4 changes: 4 additions & 0 deletions docker-compose/prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# python-facebook-chatbot: Docker Compose
# https://docs.docker.com/compose/
#
# Usage: docker-compose prod up
4 changes: 4 additions & 0 deletions docker-compose/stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# python-facebook-chatbot: Docker Compose
# https://docs.docker.com/compose/
#
# Usage: docker-compose stage up
13 changes: 13 additions & 0 deletions docker-compose/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# python-facebook-chatbot: Docker Compose
# https://docs.docker.com/compose/
#
# Usage: test up
version: '3'
services:

app:
environment: &environment
- APP_NAME=python-facebook-chatbot
build:
context: .
dockerfile: docker/app-test/Dockerfile
12 changes: 12 additions & 0 deletions docker/app-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.6.0

MAINTAINER Luis Mayta <@slovacus>

COPY ./requirements/ /usr/src/requirements/
COPY ./requirements.txt /usr/src/requirements.txt

# set working directory to /app/
WORKDIR /usr/src

# install python dependencies
RUN pip install -r /usr/src/requirements/test.txt
12 changes: 12 additions & 0 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.6.0

MAINTAINER Luis Mayta <@slovacus>

COPY ./requirements/ /usr/src/requirements/
COPY ./requirements.txt /usr/src/requirements.txt

# set working directory to /app/
WORKDIR /usr/src

# install python dependencies
RUN pip install -r /usr/src/requirements/dev.txt
14 changes: 14 additions & 0 deletions docker/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM labpositiva/latex:3.6.1
MAINTAINER Luis Mayta <@slovacus>

COPY ./requirements/ /app/requirements/
COPY ./requirements.txt /app/requirements.txt

RUN apt-get update -y \
&& apt-get install -y build-essential

# set working directory to /app/
WORKDIR /app

# Install sphinx dependences
RUN pip install -r /app/requirements/docs.txt
16 changes: 0 additions & 16 deletions docker/web/Dockerfile

This file was deleted.

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = Python-Facebook-Chatbot
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
82 changes: 82 additions & 0 deletions docs/_templates/links.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
.. _Rest: http://es.wikipedia.org/wiki/Representational_State_Transfer
.. AWS
.. _ssh: https://en.wikipedia.org/wiki/Secure_Shell
.. _aws route53: https://aws.amazon.com/route53/
.. _aws elasticache: https://aws.amazon.com/elasticache/
.. _aws rds: https://aws.amazon.com/rds/
.. _aws sqs: https://aws.amazon.com/sqs/
.. _aws dynamodb: https://aws.amazon.com/dynamodb/
.. _aws elb: https://aws.amazon.com/elasticloadbalancing
.. _aws cloudfront: https://aws.amazon.com/cloudfront/
.. _aws s3: https://aws.amazon.com/s3/
.. _aws ec2: https://aws.amazon.com/ec2/

.. code developer
.. _cloud computing: https://en.wikipedia.org/wiki/Cloud_computing
.. _git: https://git-scm.com/
.. _repositorio: https://bitbucket.org/lapositivatd/python-facebook-chatbot
.. _company: https://bitbucket.org/lapositivatd
.. _Python 3.6.0: https://www.python.org/downloads/release/python-360
.. _Docker: https://www.docker.com/
.. _Docker Compose: https://docs.docker.com/compose
.. _Django: https://www.djangoproject.com/

.. Referencias
.. _La positiva: https://www.lapositiva.com.pe/
.. _medium.com: https://medium.com
.. _airbnb: https://www.airbnb.com/
.. _spotify: https://www.spotify.com/
.. _dropbox: https://www.dropbox.com

.. Tecnologies
.. _webhook: https://en.wikipedia.org/wiki/Webhook
.. _IoT: https://en.wikipedia.org/wiki/Internet_of_things
.. _DynamoDB: https://aws.amazon.com/dynamodb/
.. _PostgreSQL: https://www.postgresql.org
.. _RabbitMQ: http://www.rabbitmq.com
.. _Supervisor: http://supervisord.org/index.html
.. _Redis: http://redis.io
.. _ApacheSolr: http://lucene.apache.org/solr
.. _Vagrant: http://www.vagrantup.comhttp://bundler.io/
.. _GitHub: https://github.com
.. _Bitbucket: https://bitbucket.org
.. _Terraform: https://www.terraform.io/
.. _Wercker: https://www.wercker.com/


.. Security
.. _oauth2: https://oauth.net/2/

.. Extensiones
.. Autores
.. Web Framework
.. Librerias
.. Gestor de Dependencias
.. Packages Python
.. Standard code
.. _PEP 8: https://www.python.org/dev/peps/pep-0008/
.. _PEP 257: https://www.python.org/dev/peps/pep-0257/

.. Tools Development
.. _Pre Commit: https://github.com/observing/pre-commit
.. _shellcheck: https://github.com/koalaman/shellcheck
.. _pyenv: https://github.com/pyenv/pyenv
.. _tmuxinator: https://github.com/tmuxinator/tmuxinator
.. _Gherkin: https://github.com/cucumber/cucumber/wiki/Gherkin
.. _Behave: http://pythonhosted.org/behave/

..
Servicios Cloud
.. _Azure: https://azure.microsoft.com/en-us/
.. _Google Cloud Platform: https://cloud.google.com
.. _AWS: https://aws.amazon.com
29 changes: 29 additions & 0 deletions docs/architecture/componentes/Api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Api
***


`AWS Route53`_
==============

AWS CloudFront
==============

AWS S3
======

AWS ELB Elastic Load Balancer (ELB)
===================================


AWS SQS
=======


AWS DynamoDB
============


.. include:: ../../_templates/links.rst


.. rubric:: Footnotes
15 changes: 15 additions & 0 deletions docs/architecture/componentes/WebHooks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
WebHooks
********

Aws ApiGateWay
==============


Aws Lambda
==========


.. include:: ../../_templates/links.rst


.. rubric:: Footnotes
9 changes: 9 additions & 0 deletions docs/architecture/componentes/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Componentes
***********

.. toctree::

Api
WebHooks

.. include:: ../../_templates/links.rst
5 changes: 5 additions & 0 deletions docs/architecture/consideraciones.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Consideraciones
===============


.. include:: ../_templates/links.rst
90 changes: 90 additions & 0 deletions docs/architecture/despliegue.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Despliegue
**********

El despliegue de los componentes se encuentra claramente definido en la
siguiente imagen:


.. uml::

left to right direction

actor Admin
node "Laptop"
component "Terraform"
component "ansible"
artifact "Inventory"
artifact "playbook"
cloud AWS
node Application
node ActiveMQ
node Other1
[Admin] --> [Laptop]
[Laptop] --> [Terraform]
[Terraform] --> [ansible]
[ansible] <- [Inventory]
[ansible] <- [playbook]
[ansible] -- [AWS]
[AWS] -- [Application]
[AWS] -- [ActiveMQ]
[AWS] -- [Other1]

Pasos
=====

Orquestar servicios:
--------------------

.. code-block:: bash
λ terraform init
λ make decrypt_vars env=stage
λ terraform apply
λ make encrypt_vars env=stage
Orquestar Servidores:
---------------------

.. code-block:: bash
λ make ansible_provision env=stage
λ make ansible_deploy env=stage
Orquestar Servidores:
---------------------

.. code-block:: bash
λ make ansible_provision env=stage
λ make ansible_deploy env=stage
Desplegar Aplicacion
--------------------

.. code-block:: bash
λ make ansible_deploy_tags env=stage tags=deployment
Admin
=====


Laptop
======

Terraform
=========

Ansible
=======

Inventory
---------

Playbook
--------


.. rubric:: Notas

.. include:: ../_templates/links.rst
Loading

0 comments on commit 069fd66

Please sign in to comment.