Commit 9b41fed8 authored by Alfonso Rafael Solis Rangel's avatar Alfonso Rafael Solis Rangel
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
name: Deploy to GitHub Actions

on:
  push:
    branches:
      - "develop"

permissions:
  contents: read

jobs:

  deploy:

    name: Deployment
    runs-on: ubuntu-latest
    environment: dev

    steps:
      - uses: actions/checkout@v3.1.0
      - name: Build the images and start the containers
        run: |
          ls -la
          docker-compose up -d
          docker-compose ps
          echo "-------------------------------------"
          sleep 5
          docker-compose ps

      - name: Stop containers
        if: always()
        run: docker-compose down
 No newline at end of file
+32 −0
Original line number Diff line number Diff line
name: Deploy to GitHub Actions

on:
  push:
    branches:
      - "master"

permissions:
  contents: read

jobs:

  deploy:

    name: Deployment
    runs-on: ubuntu-latest
    environment: prod

    steps:
      - uses: actions/checkout@v3.1.0
      - name: Build the images and start the containers
        run: |
          ls -la
          docker-compose up -d
          docker-compose ps
          echo "-------------------------------------"
          sleep 5
          docker-compose ps

      - name: Stop containers
        if: always()
        run: docker-compose down
 No newline at end of file
+32 −0
Original line number Diff line number Diff line
name: Deploy to GitHub Actions

on:
  push:
    branches:
      - "staging"

permissions:
  contents: read

jobs:

  deploy:

    name: Deployment
    runs-on: ubuntu-latest
    environment: staging

    steps:
      - uses: actions/checkout@v3.1.0
      - name: Build the images and start the containers
        run: |
          ls -la
          docker-compose up -d
          docker-compose ps
          echo "-------------------------------------"
          sleep 5
          docker-compose ps

      - name: Stop containers
        if: always()
        run: docker-compose down
 No newline at end of file

.gitignore

0 → 100644
+71 −0
Original line number Diff line number Diff line
# Django #
*.log
*.pot
*.pyc
__pycache__/
db.sqlite3
media
migrations

# Backup files # 
*.bak 

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Python # 
*.py[cod] 
*$py.class 


# Unit test / coverage reports 
htmlcov/ 
.tox/ 
.coverage 
.coverage.* 
.cache 
.pytest_cache/ 
nosetests.xml 
coverage.xml 
*.cover 
.hypothesis/ 

# pyenv 
.python-version 

# Environments 
.env 
.venv 
env/ 
venv/ 
ENV/ 
env.bak/ 
venv.bak/ 

# Visual Studio Code # 
.vscode/* 
!.vscode/settings.json 
!.vscode/tasks.json 
!.vscode/launch.json 
!.vscode/extensions.json 
.history

#db
.db/


#selenium
.DS_Store
geckodriver.log

Dockerfile

0 → 100644
+40 −0
Original line number Diff line number Diff line
FROM debian:bullseye-slim

RUN apt-get update
RUN apt-get install python3 python3-pip libmariadb-dev \
    python3-dev -y

# Configuración de zona horaria.
ENV TZ=America/Mexico_City
RUN ln -snf  /etc/l/usr/share/zoneinfo/$TZocaltime && echo $TZ > /etc/timezone

# Entorno de desarrollo.
WORKDIR /app

# Agrega archivo de requerimientos.
COPY ./correspondencia/requirements.txt /app/

# Instalación de requerimientos.
RUN pip3 install -r /app/requirements.txt

# Copea el código al entorno de Docker.
COPY ./correspondencia/ /app/

# Puerto expuesto del contenedor al host.
EXPOSE 8000

# Realiza migraciones de la base de datos.
RUN python3 manage.py makemigrations usuarios
RUN python3 manage.py makemigrations ficha

# Crea un alias llamado run para correr Django.
RUN echo 'alias mig="python3 manage.py migrate"' >> ~/.bashrc

# Crea un alias llamado cs para crear super usuario en Django.
RUN echo 'alias cs="python3 manage.py createsuperuser"' >> ~/.bashrc

# Crea un alias llamado run para correr Django.
RUN echo 'alias run="python3 manage.py runserver 0.0.0.0:8001"' >> ~/.bashrc

# Comando ejecutado por defecto.
CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
Loading