Skip to content

Commit

Permalink
update cicd for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vitor authored and vitor committed Dec 11, 2023
1 parent 2d034a3 commit 0053574
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ on:

jobs:
build:
name: build, up and test
name: build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build api-pgd
run: make build
- name: Up services
run: make up
# - name: Up services
# run: make up
- name: Run tests
run: make tests
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ RUN apt-get update && \
/usr/share/doc \
/usr/share/doc-base

COPY src/ ./
COPY src/ src/

EXPOSE 5057

ENTRYPOINT ["sh", "-c", "cd /api-pgd/src && uvicorn api:app --host 0.0.0.0 --port 5057 --reload"]

ENTRYPOINT ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "5057"]
21 changes: 0 additions & 21 deletions Dockerfile.dev

This file was deleted.

4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ test:

.PHONY: build
build:
docker compose down ; docker rmi ghcr.io/gestaogovbr/api-pgd:latest-dev --force ; docker build --rm -t ghcr.io/gestaogovbr/api-pgd:latest-dev -f Dockerfile.dev .


docker compose down ; docker rmi ghcr.io/gestaogovbr/api-pgd:latest --force ; docker build --rm -t ghcr.io/gestaogovbr/api-pgd:latest .
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ O arquivo [docker-compose.yml](docker-compose.yml) descreve a `receita`
dos contêineres que compõem a solução. Atualmente são utilizados `2 containers`:

* [db](docker-compose.yml#L4); [postgres:15](https://hub.docker.com/_/postgres)
* [api-pgd](docker-compose.yml#L21); [ghcr.io/gestaogovbr/api-pgd:latest-dev](Dockerfile.dev)
* [api-pgd](docker-compose.yml#L21); [ghcr.io/gestaogovbr/api-pgd:latest](Dockerfile)

## 6. Dicas

Expand Down
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
retries: 5

api-pgd:
image: ghcr.io/gestaogovbr/api-pgd:latest-dev
image: ghcr.io/gestaogovbr/api-pgd:latest
container_name: api-pgd
depends_on:
db:
Expand All @@ -29,6 +29,7 @@ services:
volumes:
- ./:/api-pgd
environment:
TAG_NAME: dev
ALGORITHM: HS256
API_PGD_ADMIN_USER: [email protected]
API_PGD_ADMIN_PASSWORD: secret
Expand All @@ -38,8 +39,6 @@ services:
# to new `SECRET` run openssl rand -hex 32
SECRET: b8a3054ba3457614e95a88cc0807384430c1b338a54e95e4245f41e060da68bc
ACCESS_TOKEN_EXPIRE_MINUTES: 30
command:
bash -c "cd /api-pgd/src && uvicorn api:app --host 0.0.0.0 --port 5057 --reload"
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:5057/docs"]
interval: 5s
Expand Down

0 comments on commit 0053574

Please sign in to comment.