Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Feat/add pipeline #520

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 14 additions & 68 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,16 @@
name: CI

on: [ push, pull_request ]

name: "Pipeline para build de imagem docker"
on:
push:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements.txt
- name: Lint
run: |
black --check .
flake8 .
- name: Check migrations
env:
DJANGO_SETTINGS_MODULE: "web.settings"
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/mariaquiteria"
run: python manage.py makemigrations --check
- name: Run Tests
env:
DJANGO_SETTINGS_MODULE: "web.settings"
DJANGO_CONFIGURATION: "Test"
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/mariaquiteria"
run: |
python manage.py collectstatic
pytest
services:
postgres:
image: library/postgres:11-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: mariaquiteria
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
rabbitmq:
image: rabbitmq
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672:5672
deploy:
runs-on: ubuntu-18.04
if: github.ref == 'refs/heads/main'
docker:
uses: "mentoriaiac/cicd_centralizado/.github/workflows/docker_build.yaml@v1"
with:

image: wf975621/mariaqueteria
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temos um typo por aqui :) mariaquiteria


steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Push to dokku
uses: dokku/github-action@v1.0.2
with:
branch: main
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
git_remote_url: ${{ secrets.DOKKU_REMOTE_URL }}
ssh_host_key: ${{ secrets.SSH_HOST_KEY }}
needs: [build]
push_image: ${{github.event_name == 'release'}}
secrets:
docker_user: ${{secrets.DOCKER_LOGIN}}
docker_password: ${{secrets.TOKEN_DOCKERHUB}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
docker_password: ${{secrets.TOKEN_DOCKERHUB}}
docker_password: ${{secrets.TOKEN_DOCKERHUB}}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quebra de linha

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ __pycache__

# scrapy
files/

teste
12 changes: 12 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CVE-2022-1304
CVE-2021-3999
CVE-2019-8457
CVE-2021-33560
CVE-2022-2509
CVE-2022-29458
CVE-2022-1586
CVE-2022-1587
CVE-2022-2097
CVE-2020-16156
CVE-2022-34265
CVE-2017-14158
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pode adicionar uma quebra de linha aqui também?

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /code

COPY requirements.txt .
COPY dev_requirements.txt .

# hadolint ignore=DL3008,DL3042,DL3027,DL3015
RUN apt-get update && \
apt-get install -y netcat-openbsd gcc && \
apt-get clean && \
Expand Down