Merge pull request 'feat/live-preview' (#2) from feat/live-preview into Release/V0.0.3
All checks were successful
Release Deployment Pipeline / Run Tests (push) Has been skipped
Release Deployment Pipeline / Tests Skipped (push) Successful in 1s
Release Deployment Pipeline / Build Multi-Arch Image and Deploy (push) Has been skipped
Release Deployment Pipeline / Rollback on Failure (push) Has been skipped
All checks were successful
Release Deployment Pipeline / Run Tests (push) Has been skipped
Release Deployment Pipeline / Tests Skipped (push) Successful in 1s
Release Deployment Pipeline / Build Multi-Arch Image and Deploy (push) Has been skipped
Release Deployment Pipeline / Rollback on Failure (push) Has been skipped
Reviewed-on: http://git.carneiro.ddnsfree.com/ricardo/BCards/pulls/2
This commit is contained in:
commit
9e271930ee
@ -9,13 +9,22 @@ env:
|
||||
REGISTRY: registry.redecarneir.us
|
||||
IMAGE_NAME: bcards
|
||||
MONGODB_HOST: 192.168.0.100:27017
|
||||
# Variável para controlar execução dos testes
|
||||
SKIP_TESTS: ${{ vars.SKIP_TESTS || 'false' }}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run Tests
|
||||
runs-on: ubuntu-latest
|
||||
# Só executa se SKIP_TESTS não for 'true'
|
||||
if: ${{ vars.SKIP_TESTS != 'true' }}
|
||||
|
||||
steps:
|
||||
- name: Show test status
|
||||
run: |
|
||||
echo "🧪 SKIP_TESTS = ${{ vars.SKIP_TESTS }}"
|
||||
echo "✅ Executando testes porque SKIP_TESTS != 'true'"
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@ -38,12 +47,35 @@ jobs:
|
||||
echo "Testing MongoDB connection to $MONGODB_HOST"
|
||||
timeout 10 bash -c "</dev/tcp/192.168.0.100/27017" && echo "MongoDB connection successful" || echo "MongoDB connection failed"
|
||||
|
||||
# Job para mostrar quando os testes foram pulados
|
||||
test-skipped:
|
||||
name: Tests Skipped
|
||||
runs-on: ubuntu-latest
|
||||
# Só executa se SKIP_TESTS for 'true'
|
||||
if: ${{ vars.SKIP_TESTS == 'true' }}
|
||||
|
||||
steps:
|
||||
- name: Show skip message
|
||||
run: |
|
||||
echo "⚠️ SKIP_TESTS = ${{ vars.SKIP_TESTS }}"
|
||||
echo "⏭️ Testes foram PULADOS por configuração"
|
||||
echo "🔧 Para ativar os testes, defina SKIP_TESTS=false ou remova a variável"
|
||||
|
||||
build-and-deploy:
|
||||
name: Build Multi-Arch Image and Deploy
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
# Depende de qualquer um dos jobs de teste (executado ou pulado)
|
||||
needs: [test, test-skipped]
|
||||
# Só executa se pelo menos um dos jobs anteriores foi bem-sucedido ou pulado
|
||||
if: always() && (needs.test.result == 'success' || needs.test.result == 'skipped' || needs.test-skipped.result == 'success')
|
||||
|
||||
steps:
|
||||
- name: Show deployment status
|
||||
run: |
|
||||
echo "🚀 Iniciando deployment..."
|
||||
echo "📊 Test job result: ${{ needs.test.result }}"
|
||||
echo "📊 Test-skipped job result: ${{ needs.test-skipped.result }}"
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@ -133,12 +165,13 @@ jobs:
|
||||
echo "🏗️ Architecture: Multi-arch (linux/amd64, linux/arm64)"
|
||||
echo "📋 Branch: ${{ steps.extract_branch.outputs.branch }}"
|
||||
echo "🆔 Commit: ${{ steps.extract_branch.outputs.commit }}"
|
||||
echo "🧪 Tests: ${{ vars.SKIP_TESTS == 'true' && 'SKIPPED' || 'PASSED' }}"
|
||||
|
||||
rollback:
|
||||
name: Rollback on Failure
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test, build-and-deploy]
|
||||
if: failure()
|
||||
if: failure() && needs.test.result != 'skipped'
|
||||
|
||||
steps:
|
||||
- name: Rollback deployment
|
||||
|
||||
@ -13,6 +13,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{02EA
|
||||
scripts\test-mongodb-connection.sh = scripts\test-mongodb-connection.sh
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pipeline", "Pipeline", "{3F3DEEDF-9E0A-434D-8130-1FBAC43FD1F7}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.gitea\workflows\release-deploy.yml = .gitea\workflows\release-deploy.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
||||
20
src/BCards.Web/appSettings.Testing.json
Normal file
20
src/BCards.Web/appSettings.Testing.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore": "Warning"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "mongodb://localhost:27017/BCardsDB_Testing"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"JWT": {
|
||||
"Secret": "ThisIsATestSecretKeyForJWTTokenGeneration123456789",
|
||||
"Issuer": "BCards-Testing",
|
||||
"Audience": "BCards-Users-Testing",
|
||||
"ExpiryMinutes": 60
|
||||
},
|
||||
"Environment": "Testing"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user