-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajustado e-mail de confirmacao e CI/CD
- Loading branch information
1 parent
714545b
commit 411c7ac
Showing
12 changed files
with
1,237 additions
and
928 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
fly.toml | ||
.git/ | ||
*.sqlite3 | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Deploy | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- Integração contínua | ||
types: | ||
- completed | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Fly CLI | ||
uses: superfly/flyctl-actions/setup-flyctl@master | ||
|
||
- name: Fetch Fly.io secrets | ||
id: fetch_secrets | ||
run: | | ||
chmod +x ./set_secrets.sh | ||
./set_secrets.sh | ||
if: always() # Importante: executa mesmo com erro para melhor logging | ||
|
||
- name: Deploy to Fly.io | ||
run: flyctl deploy --remote-only | ||
env: | ||
EMAIL_BACKEND: ${{ env.EMAIL_BACKEND }} | ||
EMAIL_HOST: ${{ env.EMAIL_HOST }} | ||
EMAIL_PORT: ${{ env.EMAIL_PORT }} | ||
EMAIL_USE_TLS: ${{ env.EMAIL_USE_TLS }} | ||
EMAIL_HOST_USER: ${{ env.EMAIL_HOST_USER }} | ||
EMAIL_HOST_PASSWORD: ${{ env.EMAIL_HOST_PASSWORD }} | ||
DEFAULT_FROM_EMAIL: ${{ env.DEFAULT_FROM_EMAIL }} | ||
if: steps.fetch_secrets.outcome == 'success' # Só deploya se a etapa anterior foi bem sucedida | ||
|
||
environment: | ||
name: production | ||
url: https://eventex.fly.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -e # Sai imediatamente se houver qualquer erro | ||
|
||
# Tenta obter cada secret e define uma variável. Se falhar, sai com erro. | ||
EMAIL_BACKEND=$(flyctl secrets get EMAIL_BACKEND) || exit 1 | ||
EMAIL_HOST=$(flyctl secrets get EMAIL_HOST) || exit 1 | ||
EMAIL_PORT=$(flyctl secrets get EMAIL_PORT) || exit 1 | ||
EMAIL_USE_TLS=$(flyctl secrets get EMAIL_USE_TLS) || exit 1 | ||
EMAIL_HOST_USER=$(flyctl secrets get EMAIL_HOST_USER) || exit 1 | ||
EMAIL_HOST_PASSWORD=$(flyctl secrets get EMAIL_HOST_PASSWORD) || exit 1 | ||
DEFAULT_FROM_EMAIL=$(flyctl secrets get DEFAULT_FROM_EMAIL) || exit 1 | ||
|
||
# Define as variáveis de ambiente do GitHub Actions | ||
echo "EMAIL_BACKEND=$EMAIL_BACKEND" >> $GITHUB_ENV | ||
echo "EMAIL_HOST=$EMAIL_HOST" >> $GITHUB_ENV | ||
echo "EMAIL_PORT=$EMAIL_PORT" >> $GITHUB_ENV | ||
echo "EMAIL_USE_TLS=$EMAIL_USE_TLS" >> $GITHUB_ENV | ||
echo "EMAIL_HOST_USER=$EMAIL_HOST_USER" >> $GITHUB_ENV | ||
echo "EMAIL_HOST_PASSWORD=$EMAIL_HOST_PASSWORD" >> $GITHUB_ENV | ||
echo "DEFAULT_FROM_EMAIL=$DEFAULT_FROM_EMAIL" >> $GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,9 +58,9 @@ def setUp(self): | |
def test_email(self): | ||
qs = Contact.objects.emails() | ||
expected = ['[email protected]'] | ||
self.assertQuerysetEqual(qs, expected, lambda o: o.value) | ||
self.assertListEqual(list(qs.values_list('value', flat=True)), expected) | ||
|
||
def test_phones(self): | ||
qs = Contact.objects.phones() | ||
expected = ['21-996186180'] | ||
self.assertQuerysetEqual(qs, expected, lambda o: o.value) | ||
self.assertListEqual(list(qs.values_list('value', flat=True)), expected) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters