https://github.com/baptvit/simple-ci
Simple and powerful continuous integration pipeline for microservices development teams
https://github.com/baptvit/simple-ci
ci django docker git git-actions postgresql
Last synced: 3 months ago
JSON representation
Simple and powerful continuous integration pipeline for microservices development teams
- Host: GitHub
- URL: https://github.com/baptvit/simple-ci
- Owner: baptvit
- License: apache-2.0
- Created: 2020-03-28T15:21:54.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-25T02:20:07.000Z (about 4 years ago)
- Last Synced: 2025-07-27T05:31:13.871Z (11 months ago)
- Topics: ci, django, docker, git, git-actions, postgresql
- Language: Python
- Homepage:
- Size: 187 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple and powerful continuous integration pipeline for microservices development teams

[Python](https://www.python.org/) - **3.6.0**
[Django](https://www.djangoproject.com/) - **2.2.5**
[PostgreSQL]() - **11**
[Django RestFramework](https://www.django-rest-framework.org/) - 3.9.4
[Docker]() - **18.09.7**
[Docker-Compose]() - **1.24.1**
# Continues Intregration with git-actions and git-secrets

1 - Create git secrets variables for the sensitive variables.
* Settings > Secrets > Add all the secrets.

* Those secrets are encrypted variables used in workflows/main.yml.
2 - This simple pipeline is powerful for microservices development teamns.
3 - First enforce the code style using PEP 8 best practies.
4 - Build images and Run unit tests.
# Installations on localhost
## Create a .env for [Python Decouple](https://pypi.org/project/python-decouple/) sensitive variables:
1 - Create enviroment variables for using in .env
```
$ export API_DB_USER=
$ export API_DB_PASS=
$ export API_DB_DATABASE=
```
2 - Create the .env in manage.py's directory
```
.env
SECRET_KEY=<$DJANGO_SECRET_KEY>
DATABASE_URL= postgres://<$API_DB_USER>:<$API_DB_PASS>@db_postgres:5432/<$API_DB_DATABASE>
PG_PASS=<$PG_ADMIN_ROOT_PASS>
```
3 - Building all images for later be using for containers:
```
$ make build
```
4 - Execute this command to create PostgreSQL database name as db_postgres:
```
make up-postgresql
```
5 - Wait 10s and then execute those commands to set username and password credentials for database:
```
Create role with enviroment variables
$ make create-role
```
```
Alter role to be active
$ make alter-role
```
```
Alter role to give permission to create database
$ make permission-role
```
```
Create Database for django
$ make create-db
```
6 - If you wanna up all contaieners:
```
make up
```
7 - Create API container in development mode with deamons:
```
make run
```
## API Simple structure as a CRUD
### produto:
* Urls:
* api/produto/ \
* / \
* /create \
* /detail-update/{id} \
* /delete/{id}
### predido:
* Urls:
* api/produto/ \
* / \
* /create \
* /detail-update/{id} \
* /delete/{id}