-
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.
Merge pull request #36 from eduardo-paes/staging
Staging
- Loading branch information
Showing
982 changed files
with
43,931 additions
and
11,305 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Deploy WebFunctions to Azure | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
env: | ||
AZURE_FUNCTIONAPP_NAME: "GPIC-Stg-WebFunctions" # set this to your function app name on Azure | ||
AZURE_FUNCTIONAPP_PACKAGE_PATH: "src" # set this to the path to your function app project, defaults to the repository root | ||
DOTNET_VERSION: "7.0" # set this to the dotnet version to use (e.g. '2.1.x', '3.1.x', '5.0.x') | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest # For Linux, use ubuntu-latest | ||
environment: dev | ||
steps: | ||
- name: "Checkout GitHub Action" | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: "Resolve Project Dependencies Using Dotnet" | ||
shell: bash # For Linux, use bash | ||
run: | | ||
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' | ||
dotnet build --configuration Release --output ./output | ||
popd | ||
- name: Create env | ||
run: | | ||
echo "AZURE_BLOB_STORAGE_CONNECTION_STRING=${{ secrets.AZURE_BLOB_STORAGE_CONNECTION_STRING }} | ||
AZURE_BLOB_STORAGE_CONTAINER_NAME=${{ secrets.AZURE_BLOB_STORAGE_CONTAINER_NAME }} | ||
POSTGRES_CONNECTION_STRING=${{ secrets.POSTGRES_CONNECTION_STRING }} | ||
FRONTEND_URL=${{ secrets.FRONTEND_URL }} | ||
ALLOW_ORIGINS=${{ secrets.ALLOW_ORIGINS }} | ||
JWT_AUDIENCE=${{ secrets.JWT_AUDIENCE }} | ||
JWT_EXPIRE_IN=${{ secrets.JWT_EXPIRE_IN }} | ||
JWT_ISSUER=${{ secrets.JWT_ISSUER }} | ||
JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }} | ||
SEQ_API_KEY=${{ secrets.SEQ_API_KEY }} | ||
SEQ_URL=${{ secrets.SEQ_URL }} | ||
SMTP_EMAIL_PASSWORD=${{ secrets.SMTP_EMAIL_PASSWORD }} | ||
SMTP_EMAIL_USERNAME=${{ secrets.SMTP_EMAIL_USERNAME }} | ||
EXECUTE_MIGRATION=${{ secrets.EXECUTE_MIGRATION }}" > src/Infrastructure/WebAPI/.env | ||
- name: "Run Azure Functions Action" | ||
uses: Azure/functions-action@v1 | ||
id: fa | ||
with: | ||
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} | ||
package: "${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output" | ||
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} # Remove publish-profile to use Azure RBAC |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{ | ||
"recommendations": [] | ||
"recommendations": [ | ||
"ms-azuretools.vscode-azurefunctions", | ||
"ms-dotnettools.csharp" | ||
] | ||
} |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
{ | ||
"dotnet-test-explorer.testProjectPath": "src/Domain.Tests/Domain.Tests.csproj" | ||
} | ||
// "dotnet-test-explorer.testProjectPath": "src/Domain.Tests/Domain.Tests.csproj", | ||
"dotnet-test-explorer.testProjectPath": "src/Application.Tests/Application.Tests.csproj", | ||
"dotnet.defaultSolution": "src/GPIC.BackEnd.sln", | ||
"azureFunctions.deploySubpath": "src/Infrastructure/WebFunctions/bin/Release/net7.0/publish", | ||
"azureFunctions.projectLanguage": "C#", | ||
"azureFunctions.projectRuntime": "~4", | ||
"debug.internalConsoleOptions": "neverOpen", | ||
"azureFunctions.projectSubpath": "src/Infrastructure/WebFunctions", | ||
"azureFunctions.preDeployTask": "publish (functions)" | ||
} |
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 |
---|---|---|
@@ -1,66 +1,3 @@ | ||
# Infrastructure.WebAPI | ||
# GPIC WebAPI / WebFunctions | ||
|
||
Restful API created in .NET 7.0.0 to support SPA. | ||
|
||
## DataBase - PostgreSQL | ||
|
||
Para levantar o banco de dados é necessário executar o comando abaixo na pasta raiz: | ||
|
||
```bash | ||
cd docker | ||
docker compose up -d | ||
``` | ||
|
||
Em seguida, é preciso acessar o pgAdmin através da rota abaixo: | ||
|
||
- [PGAdmin](http://localhost:16543/browser) | ||
|
||
E criar um servidor utilizando as informações de _host_, _username_, _password_ e _database_ que estão informadas no arquivo docker-compose.yaml utilizado. | ||
Exemplo: | ||
|
||
- **host**: copet-system-db | ||
- **username**: copet-admin | ||
- **password**: Copet@123 | ||
- **database**: COPET_DB | ||
- **port**: 5432 | ||
|
||
## Migrations | ||
|
||
Criando as Migrations iniciais para criação das tabelas do banco de dados: | ||
|
||
```bash | ||
cd src/Infrastructure/WebAPI | ||
dotnet ef migrations add Initialize --project ../Persistence/Persistence.csproj | ||
``` | ||
|
||
Executando as Migrations: | ||
|
||
```bash | ||
dotnet ef database update | ||
``` | ||
|
||
Removendo as Migrations: | ||
|
||
```bash | ||
cd src/Infrastructure/WebAPI | ||
dotnet ef migrations remove --project ../Persistence/Persistence.csproj | ||
``` | ||
|
||
## Execução com Dotnet | ||
|
||
Comandos para execução do projeto .NET utilizando CLI: | ||
|
||
```bash | ||
cd Infrastructure.WebAPI | ||
dotnet build | ||
dotnet run | ||
``` | ||
|
||
## Execucação com Docker | ||
|
||
Comandos para execução do projeto .NET utilizando Docker: | ||
|
||
```bash | ||
docker build . -t copet-system-api:dev | ||
docker run --name copet-system-api -p 8080:80 -d copet-system-api:dev | ||
``` | ||
Restful API created in .NET 7 to centralize the business rules of the GPIC system (Gerenciador de Projetos de Iniciação Científica). |
Oops, something went wrong.