Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging #36

Merged
merged 244 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
244 commits
Select commit Hold shift + click to select a range
12a2b14
chore(ci): update yml
Jul 10, 2023
39b86e9
chore(ci): update azure-webapps-dotnet-core.yml
Jul 10, 2023
25616c7
chore(ci): fix yml
Jul 10, 2023
862ea6e
chore(ci): modify build
Jul 10, 2023
62b9e19
chore(ci): update yml again
Jul 10, 2023
5dbd675
chore(ci): another try
Jul 10, 2023
03ca918
chore(ci): fixing branch
Jul 10, 2023
c86cc60
feat(webapi): add version endpoint for tests
Jul 10, 2023
4c96d06
chore(ci): set environment
Jul 10, 2023
bff332a
feat(.env): add .env file verification
Jul 10, 2023
df11ebc
chore(ci): add .env file creation
Jul 10, 2023
289b016
feat(appsettings): add azure secret support
Jul 11, 2023
00624c9
feat(ioc): add support to azure key vault
Jul 11, 2023
ea565c5
chore(.env): revert azure integration
Jul 11, 2023
8209838
Merge branch 'staging' of https://github.com/eduardo-paes/DotnetGraph…
Jul 11, 2023
6ba86be
feat(ioc): update .env reading
Jul 11, 2023
854b4f5
chore(ci): add .env test
Jul 11, 2023
86db14d
chore(ci): add dev mode config
Jul 11, 2023
32b5ae9
chore(ci): set environment variable
Jul 12, 2023
25a2aa6
chore(ci): add dev env
Jul 12, 2023
ef1e18e
chore(ci): add swagger support with xml docs
Jul 12, 2023
d18c508
chore(ci): update config
Jul 12, 2023
2eda9cf
chore(ci): add xml copy
Jul 12, 2023
52c891b
chore(ci): copy xml file in release mode
Jul 12, 2023
45f494f
refactor(domain): adjust exceptions and remove some mappers
Jul 18, 2023
82a5af5
fix(adapters): adjust GetSubAreasByArea return
Jul 18, 2023
3febd1f
fix(usecases): adjust notice creation
Jul 18, 2023
abb9dec
refactor(usecases): translate some exception msgs
Jul 18, 2023
f1b4110
fix(entity): update assistance type name
Jul 18, 2023
3aebb17
fix: adjust project usecases
Jul 18, 2023
507313e
feat(webapi): add project evaluation controller
Jul 20, 2023
adbfa51
fix(tests): adjust unit and integration tests
Jul 20, 2023
256ec14
refactor(domain): change datetime now to utcnow
Jul 20, 2023
e73ba88
fix: adjust ProjectEvaluationRepository
Jul 22, 2023
65e1d1c
fix: adjust project evalution usecases
Jul 22, 2023
f4a95dc
refactor(notice): modify entity and usecases
Jul 22, 2023
7262dcc
fix: adjust notice tests
Jul 22, 2023
80837c5
feat: add acitivity type entity
Jul 22, 2023
a0345e3
feat: add activities implementation
Jul 22, 2023
4987a5f
Revert "feat: add activities implementation"
Jul 23, 2023
bdde659
feat: add unhandler exception
Jul 24, 2023
6634ecd
feat: adjust notice and activity relation
Jul 24, 2023
993f624
fix: adjust api endpoints
Jul 24, 2023
5ccb1c2
Merge branch 'development' of https://github.com/eduardo-paes/DotnetG…
Jul 24, 2023
d9c8da5
merge: add activity files from development
Jul 24, 2023
3ff2d36
fix(webapi): adjust error type in activity controller
Jul 24, 2023
9a6b525
fix(entities): change EF constructors
Jul 25, 2023
d757dac
feat(entities): add ProjectActivity
Jul 25, 2023
e230ab7
feat(proj-activity): add contracts and repository interface
Jul 25, 2023
418862c
fix(entities): remove evaluation fields from project
Jul 25, 2023
6915fb3
fix: adjust repositories for new project entity
Jul 25, 2023
b57d8e7
feat: add ProjectActivities to Project usecases
Jul 25, 2023
5be084d
chore(persistence): upgrade Microsoft.EntityFrameworkCore packs
Jul 25, 2023
42609e4
feat: add activities to project evaluation
Jul 26, 2023
8dc8dee
feat: add activities seeder
Jul 26, 2023
2c6451c
Merge pull request #2 from eduardo-paes:development
eduardo-paes Jul 26, 2023
599f961
chore(ci): remove test variable
Jul 26, 2023
9db0791
fix: adjust project evaluation usecases
Jul 26, 2023
12aa2c3
feat(entities): add SuspensionEndDate to professor
Jul 27, 2023
a494d2a
feat(entities): add DeletedAt to ProjectEvaluation
Jul 27, 2023
4e53848
feat(usecases): add email alerts to Notice and ProjectEvaluation
Jul 27, 2023
ab75a24
feat(CORS): add CORS policy.
Jul 30, 2023
c6d6c6c
Merge branch 'staging' of github.com:eduardo-paes/CopetSystem.API int…
Jul 30, 2023
4375b35
feat: add cors configuration
Jul 31, 2023
3792787
Merge branches 'development' and 'staging' of https://github.com/edua…
Jul 31, 2023
f43d0e6
Merge pull request #4 from eduardo-paes/development
Jul 31, 2023
5aa712b
fix: adjust all namespaces
Aug 1, 2023
6805f0a
feat: add StudentDocuments endpoints
Aug 1, 2023
9d1e819
fix: adjust UpdateAreaInput namespace
Aug 2, 2023
3341b9d
feat: add RegistrationCode to student
Aug 2, 2023
fc00e73
fix: adjust Area namespaces
Aug 2, 2023
00dc890
refactor: remove Expiration from UserLoginOutput
Aug 3, 2023
a89c491
feat: add GetStudentByRegistrationCode endpoint
Aug 3, 2023
8942901
feat: add RequestStudentRegister endpoint
Aug 3, 2023
4d59cb2
refactor: replace Exectue methods for ExecuteAsync
Aug 3, 2023
991181f
refactor: add Async to EmailService methods
Aug 3, 2023
085ab3d
refactor: adjust Activity usecase methods name
Aug 3, 2023
f296ae4
refactor: add Async to StorageFileService
Aug 3, 2023
ef8e426
refactor: add Async to Repositories and Services
Aug 3, 2023
67be95d
Merge pull request #5 from eduardo-paes:development
eduardo-paes Aug 3, 2023
64ed9d8
feat: enable CORS
Aug 4, 2023
d77df0f
fix: adjust CORS configuration
Aug 4, 2023
a687689
Merge pull request #6 from eduardo-paes:development
eduardo-paes Aug 4, 2023
315c042
feat: add ProjectReport usecases and entity
Aug 5, 2023
fd6b610
refactor: simplify projects architecture
Aug 5, 2023
8b52603
feat(ProjectReport): add persistence configuration
Aug 5, 2023
ad6b048
feat: add ProjectReport controller
Aug 5, 2023
11ecc58
Merge pull request #7 from eduardo-paes:development
eduardo-paes Aug 5, 2023
246e6c4
tests(application): add test project
Aug 7, 2023
ea390ae
tests(domain): adjust unit tests
Aug 7, 2023
cfc8fba
tests(application): fix imports
Aug 7, 2023
86f6e54
refactor: move services interfaces to domain
Aug 8, 2023
6ebf8b2
feat(services): add certificate template
Aug 8, 2023
f784c99
feat: add partial implementation of ReportService
Aug 8, 2023
76dd9a5
fix(ioc): adjust external services imports
Aug 11, 2023
9b892b2
Merge pull request #8 from eduardo-paes:development
eduardo-paes Aug 11, 2023
602fbd3
fix: adjust email sender and disable ssl for tests
Aug 11, 2023
0cc5266
Merge pull request #9 from eduardo-paes/development
Aug 11, 2023
1965ed0
fix(email-service): enable ssl
Aug 11, 2023
2fc0b6c
Merge pull request #10 from eduardo-paes/development
Aug 11, 2023
c604b23
feat: add unit tests and entities fixing
Aug 11, 2023
40247c9
feat(logging): add seq support in azure
Aug 12, 2023
4f2b751
chore(ci): add seq to env
Aug 12, 2023
b433459
Merge pull request #11 from eduardo-paes/development
Aug 12, 2023
91479c0
refactor: recreate database fixing warnings
Aug 12, 2023
c6264ce
refactor(student): adjust CreateStudent variables
Aug 17, 2023
e4be590
feat: add more info to ReportService
Aug 17, 2023
d694954
feat: add certificate url to project
Aug 17, 2023
6bf3a9a
feat: add MakeCoordinator usecase
Aug 17, 2023
8a71658
feat: add MakeAdmin usecase
Aug 17, 2023
1280181
feat(repositories): add some implementations
Aug 17, 2023
9fbfad3
feat: add ReportService implementation
Aug 17, 2023
6e6efce
feat: add GenerateCertificate usecase
Aug 17, 2023
6595883
refactor: update ProjectReport to ProjectFinalReport
Aug 17, 2023
fbca60f
feat: add coordinator name to certificate
Aug 17, 2023
6cd2e52
feat: add make admin and coordinator endpoints
Aug 17, 2023
169d686
feat: add some scoped classes
Aug 17, 2023
a188314
fix: remove ProfessorProjectTitle from certificate
Aug 17, 2023
c8540c1
feat: add web function to generate certificates
Aug 18, 2023
c98091a
Merge pull request #13 from eduardo-paes:development
eduardo-paes Aug 18, 2023
1e5d438
feat: conclude GenerateCertificate web function
Aug 18, 2023
c4dedc2
docs(forms): add RelatorioParcial
Aug 18, 2023
87ffdeb
fix(CreateStudentDocuments): change project status
Aug 26, 2023
7f9c309
feat(Project): add endpoint to get project to evaluate
Aug 26, 2023
86aae0d
refactor: add more documentation to methods
Aug 26, 2023
24be4b9
feat(ProjectEvaluation): add student documents evaluation
Aug 26, 2023
94fc0cc
fix(EvaluateAppealProject): adjust inputs validation
Aug 26, 2023
56c8c2b
feat(Project): add ProjectPartialReport endpoints
Aug 26, 2023
fa4f910
feat(ProjectReport): add permission to deliver report 6 months ahead …
Aug 26, 2023
502fb33
feat: add impediment to opening a project for a suspended teacher
Aug 26, 2023
e6912be
Merge pull request #14 from eduardo-paes:development
eduardo-paes Aug 26, 2023
e795b80
feat: update TimerTrigger for tests
Aug 27, 2023
dd70ce6
chore: create azure-functions-app-dotnet.yml
Aug 27, 2023
241897b
feat: update web function for deployment
Aug 27, 2023
a3ab36e
feat: add description field on notice.
Aug 29, 2023
af83e0d
Merge pull request #15 from eduardo-paes/development
PSThiago Aug 29, 2023
199fbf5
chore(swagger): enable middleware in any env
Aug 30, 2023
0869294
Merge branch 'development' of https://github.com/eduardo-paes/DotnetG…
Aug 30, 2023
d963c04
Merge pull request #16 from eduardo-paes:development
eduardo-paes Aug 30, 2023
bd1dbe5
feat: disable native rate limit
Aug 30, 2023
20601e8
refactor: disable manual rate limit
Aug 30, 2023
e17da78
fix(Notice): adjust Description mapping
Aug 30, 2023
c141168
Merge pull request #17 from eduardo-paes:development
eduardo-paes Aug 30, 2023
5aaa5e9
fix: adjust NoticeUnitTests
Sep 3, 2023
5b1348e
fix(GenerateCertificate): adjust GetNoticeEndingAsync
Sep 3, 2023
b9401ba
feat: add ReportDeadlineNotificationFunction
Sep 4, 2023
0ed1b15
feat(StorageFileService): add UploadFileAsync by bytes
Sep 7, 2023
f391532
fix: adjust Notice seeder
Sep 7, 2023
cf01f29
chore: adjust appsettings fo development
Sep 7, 2023
4f45374
fix: adjust GetProjectsToEvaluate endpoint returns
Sep 7, 2023
ac207c4
fix: adjust oderby to avoid get errors
Sep 7, 2023
4b9be7c
feat: add manual rate limit
Sep 7, 2023
6199e9e
refactor: modify projects to add docker support
Sep 7, 2023
ee31f6c
refactor: re-create solution
Sep 7, 2023
6ca37e9
fix: add space before logo on email templates
Sep 7, 2023
73351b9
feat: add migrations to git
Sep 7, 2023
ce77ec7
chore: adjust webfunctions dockerfile
Sep 7, 2023
9086f2d
Merge pull request #18 from eduardo-paes:development
eduardo-paes Sep 7, 2023
b55803d
feat: add temporary folder creation
Sep 11, 2023
883b58b
feat: create directory for local storage if doesn't exist
Sep 14, 2023
37ba74e
chore: add docker-compose for webfunction
Sep 14, 2023
7f8401f
feat: add ClosePendingProjects web function
Sep 14, 2023
7cedd17
feat: add front-end url to emails
Sep 14, 2023
f6a516b
tests: add more project unit tests
Sep 14, 2023
bddec37
test: add more project unit tests
Sep 14, 2023
f58863b
test: add GetActivitiesByNoticeIdTests
Sep 14, 2023
a77fe0e
test: add GetLastNoticeActivitiesTests
Sep 14, 2023
5785b69
test: add AssistanceType tests
Sep 14, 2023
0dbd809
Merge branch 'development' of https://github.com/eduardo-paes/DotnetG…
Sep 14, 2023
c9e9f16
test: add Auth tests
Sep 14, 2023
db9a342
test: add Campus tests
Sep 14, 2023
13ef2e2
test: add Course tests
Sep 14, 2023
0d5070d
test: add MainArea tests
Sep 14, 2023
ea9b4ff
test: add CreateNoticeTests
Sep 15, 2023
0d47a93
feat: add skip/take validations for usecases
Sep 16, 2023
f8023f5
test: add Notice tests
Sep 16, 2023
9e5bd6f
test: add CreateProfessorTests
Sep 16, 2023
f81f5fe
chore(ci): stop CI automation
Sep 17, 2023
c378964
Merge pull request #19 from eduardo-paes/development
Sep 17, 2023
5bc6e9f
test: add DeleteProfessor tests
Sep 21, 2023
0fc2623
fix: allow anonymous some endpoints
Sep 26, 2023
b3b6299
Merge pull request #20 from eduardo-paes/development
Sep 26, 2023
772e721
docs: Add some images for documentation
Oct 11, 2023
6ea9f1e
feat: Add ProfessorId or StudentId to JWT token
Oct 11, 2023
9859dc4
tests: Adjust auth tests
Oct 11, 2023
33b2333
fix: adjust activities seeder.
Oct 12, 2023
3001960
Merge branch 'development' of github.com:eduardo-paes/CopetSystem.Web…
Oct 12, 2023
8d258a8
fix: Correction on project opening.
Oct 12, 2023
486a46c
fix: Adjust admin user login and default seeding
Oct 14, 2023
cc995ed
feat: Add GetActivitiesByProjectId endpoint
Oct 17, 2023
7bb760c
Merge branch 'development' of github.com:eduardo-paes/CopetSystem.Web…
Oct 18, 2023
0d8efec
docs: Add more images to docs folder
Oct 24, 2023
ce313aa
chore: Add version to csprojs
Oct 24, 2023
579bd04
chore(release): 0.0.1
Oct 24, 2023
e36c5c9
Merge pull request #22 from eduardo-paes/development
Oct 24, 2023
dbb27a5
chore(ci): Reactive WebApp CI
Oct 24, 2023
24c2f9b
Merge pull request #23 from eduardo-paes/development
Oct 24, 2023
3cf8d8e
chore(ci): Update AZURE_WEBAPP_NAME
Oct 24, 2023
0f1cf49
Merge pull request #24 from eduardo-paes/development
Oct 24, 2023
5521717
chore(ci): Update WebAPI script
Oct 24, 2023
302b6e3
Merge pull request #25 from eduardo-paes/development
Oct 24, 2023
dfa7349
chore(ci): Update WebAPI script
Oct 24, 2023
0303900
Merge branch 'development' of https://github.com/eduardo-paes/DotnetG…
Oct 24, 2023
c12f693
Merge pull request #26 from eduardo-paes/development
Oct 24, 2023
eb8cde4
feat: Add CORS configuration
Oct 24, 2023
1911727
Merge pull request #27 from eduardo-paes:development
eduardo-paes Oct 24, 2023
a5557d4
fix: Enable correct StorageFileService
Oct 25, 2023
a327cb6
Merge pull request #28 from eduardo-paes:development
eduardo-paes Oct 25, 2023
1db06ee
Merge branch 'development' of github.com:eduardo-paes/CopetSystem.Web…
Oct 25, 2023
9868851
fix: Disable CORS policy for tests
Oct 25, 2023
ef6a3ce
Merge branch 'development' of https://github.com/eduardo-paes/DotnetG…
Oct 25, 2023
a4ca9ea
Merge pull request #29 from eduardo-paes:development
eduardo-paes Oct 25, 2023
2283568
fix: Enable IpRateLimiting in Startup
Oct 25, 2023
af155e3
Merge pull request #30 from eduardo-paes:development
eduardo-paes Oct 25, 2023
05e2610
feat: Add user names to project GET endpoints
Oct 28, 2023
e3e1d2d
docs: Add more images to docs folder
Oct 28, 2023
b0f0877
Merge pull request #31 from eduardo-paes:development
eduardo-paes Oct 28, 2023
61e2e29
test: Add more professor usecase tests
Oct 28, 2023
ed53204
test: Add program type usecase tests
Oct 28, 2023
cd6ed40
test: Add user usecases tests
Oct 28, 2023
e4774ed
fix: Adjust GetUserById usecase
Oct 28, 2023
75ae476
fix: Adjust subarea usecases
Oct 28, 2023
ef345cf
test: Add subarea usecases tests
Oct 28, 2023
dbdbc13
test: Add student documents usecases tests
Oct 29, 2023
4ba3fc4
test: Add student usecases tests
Oct 29, 2023
2b54d92
refactor: Remove unnecessary usings
Oct 29, 2023
50f53c0
refactor: Remove all unnecessary usings
Oct 29, 2023
2b0a836
test: Add project usecases tests
Nov 1, 2023
1fd4154
test: Add ProjectEvaluation usecases tests
Nov 1, 2023
47e057e
test: Add ProjectFinalReport usecases tests
Nov 1, 2023
f26b0b2
test: Add ProjectPartialReport usecases tests
Nov 1, 2023
a6a2296
Merge pull request #32 from eduardo-paes:development
eduardo-paes Nov 1, 2023
29218aa
chore(ci): Add tests to WebAPI
Nov 1, 2023
76b6ede
chore(release): 0.1.0
Nov 1, 2023
6e21c69
Merge pull request #33 from eduardo-paes:development
eduardo-paes Nov 1, 2023
a639b44
chore(ci): Update WebAPI yaml
Nov 1, 2023
f2bd679
Merge pull request #34 from eduardo-paes:development
eduardo-paes Nov 1, 2023
7023ca6
chore(ci): Update WebAPI YAML
Nov 1, 2023
c50556b
Merge pull request #35 from eduardo-paes:development
eduardo-paes Nov 1, 2023
3ac0bbe
chore(ci): Disable tests
Nov 1, 2023
55c9fe7
chore(ci): Re-enable tests in YAML
Nov 1, 2023
759eb5e
Merge branch 'staging' of https://github.com/eduardo-paes/DotnetGraph…
Nov 1, 2023
5ed36fe
Revert "chore(ci): Disable tests"
Nov 2, 2023
20d7090
docs: Add more images to public folder
Nov 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 55 additions & 0 deletions .github/workflows/azure-functions-app-dotnet.yml
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
69 changes: 59 additions & 10 deletions .github/workflows/azure-webapps-dotnet-core.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: Build and deploy ASP.Net Core app to an Azure Web App
name: Deploy WebAPI to Azure

env:
AZURE_WEBAPP_NAME: GPIC-Staging-WebAPI # set this to the name of your Azure Web App
AZURE_WEBAPP_PACKAGE_PATH: 'src' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '7.0' # set this to the .NET Core version to use
AZURE_WEBAPP_NAME: ${{ secrets.AZURE_WEBAPP_NAME }}
AZURE_WEBAPP_PACKAGE_PATH: "."
DOTNET_VERSION: "7.0"
PROJECT_PATH: "src/Infrastructure/WebAPI/WebAPI.csproj"
WEBAPI_PATH: "src/Infrastructure/WebAPI/"
UNIT_TESTS_PROJ: "src/Domain.Tests/Domain.Tests.csproj"
INTEGRATION_TESTS_PROJ: "src/Application.Tests/Application.Tests.csproj"
ASPNETCORE_ENVIRONMENT: ${{ secrets.ASPNETCORE_ENVIRONMENT }}

on:
push:
branches: [ "main" ]
branches: ["staging"]
workflow_dispatch:

permissions:
Expand All @@ -16,6 +21,7 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
environment: STAGING

steps:
- uses: actions/checkout@v3
Expand All @@ -33,25 +39,68 @@ jobs:
restore-keys: |
${{ runner.os }}-nuget-

- 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: Set environment variable
run: echo "ASPNETCORE_ENVIRONMENT=${{ env.ASPNETCORE_ENVIRONMENT }}" >> $GITHUB_ENV

- name: Build with dotnet
run: dotnet build --configuration Release
run: dotnet build ${{env.PROJECT_PATH}} --configuration Release -o ${{env.DOTNET_ROOT}}/dist

- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
- name: Dotnet publish
run: dotnet publish ${{env.PROJECT_PATH}} -c Release -o ${{env.DOTNET_ROOT}}/myapp

- name: Copy XML documentation file
run: cp ${{env.DOTNET_ROOT}}/dist/*.xml ${{env.DOTNET_ROOT}}/myapp/

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: .net-app
path: ${{env.DOTNET_ROOT}}/myapp

test:
needs: build
runs-on: ubuntu-latest
environment: STAGING

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Run Unit Tests
run: dotnet test ${{ env.UNIT_TESTS_PROJ }} --configuration Release

- name: Run Integration Tests
run: dotnet test ${{ env.INTEGRATION_TESTS_PROJ }} --configuration Release

deploy:
permissions:
contents: none
runs-on: ubuntu-latest
needs: build
needs: test
environment:
name: 'Development'
name: STAGING
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
Expand Down
15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,21 @@ FodyWeavers.xsd
*.sln.iml

volumes
Migrations

node_modules
.DS_Store

certificate
certificate/*

RemoteFiles
RemoteFiles/*
src/Infrastructure/WebAPI/.env
storage
storage/*

temp
temp/*

files
files/*

**/.env
thunder-tests
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"recommendations": []
"recommendations": [
"ms-azuretools.vscode-azurefunctions",
"ms-dotnettools.csharp"
]
}
8 changes: 7 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
},
{
"name": "Attach to .NET Functions",
"type": "coreclr",
"request": "attach",
"processId": "${command:azureFunctions.pickProcess}"
}
]
}
}
12 changes: 10 additions & 2 deletions .vscode/settings.json
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)"
}
78 changes: 77 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,82 @@
"${workspaceFolder}/src/Infrastructure/WebAPI/WebAPI.csproj"
],
"problemMatcher": "$msCompile"
},
{
"label": "clean (functions)",
"command": "dotnet",
"args": [
"clean",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src/Infrastructure/WebFunctions"
}
},
{
"label": "build (functions)",
"command": "dotnet",
"args": [
"build",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean (functions)",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src/Infrastructure/WebFunctions"
}
},
{
"label": "clean release (functions)",
"command": "dotnet",
"args": [
"clean",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src/Infrastructure/WebFunctions"
}
},
{
"label": "publish (functions)",
"command": "dotnet",
"args": [
"publish",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean release (functions)",
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src/Infrastructure/WebFunctions"
}
},
{
"type": "func",
"dependsOn": "build (functions)",
"options": {
"cwd": "${workspaceFolder}/src/Infrastructure/WebFunctions/bin/Debug/net7.0"
},
"command": "host start",
"isBackground": true,
"problemMatcher": "$func-dotnet-watch"
}
]
}
}
67 changes: 2 additions & 65 deletions README.md
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).
Loading
Loading