fix: novo ajuste no pipeline #5

Merged
ricardo merged 1 commits from release/V1.0.0 into main 2025-05-27 03:54:30 +00:00
Showing only changes of commit e289ab4e7f - Show all commits

View File

@ -24,28 +24,24 @@ jobs:
- name: Restore dependencies
run: |
echo "Navigating to YTExtractor directory and restoring..."
cd YTExtractor
ls -la
dotnet restore
echo "Using solution file from root..."
ls -la *.sln
dotnet restore YTExtractor.sln
- name: Build application
run: |
echo "Building from YTExtractor directory..."
cd YTExtractor
dotnet build --configuration Release --no-restore
echo "Building solution from root..."
dotnet build YTExtractor.sln --configuration Release --no-restore
- name: Run tests (opcional)
run: |
echo "Running tests from YTExtractor directory..."
cd YTExtractor
dotnet test --no-build --verbosity normal || true
echo "Running tests on solution..."
dotnet test YTExtractor.sln --no-build --verbosity normal || true
- name: Publish application
run: |
echo "Publishing from YTExtractor directory..."
cd YTExtractor
dotnet publish --configuration Release --output ../publish
echo "Publishing solution..."
dotnet publish YTExtractor.sln --configuration Release --output ./publish
- name: Build Docker image
run: |
@ -55,23 +51,27 @@ jobs:
COMMIT_SHA=$(git rev-parse --short HEAD)
# Verificar onde está o Dockerfile
if [ -f "YTExtractor/Dockerfile" ]; then
echo "✅ Found Dockerfile in YTExtractor directory"
cd YTExtractor
echo "Building Docker image from YTExtractor directory..."
# O Dockerfile está em YTExtractor/YTExtractor/ baseado na estrutura mostrada
if [ -f "YTExtractor/YTExtractor/Dockerfile" ]; then
echo "✅ Found Dockerfile in YTExtractor/YTExtractor/ directory"
cd YTExtractor/YTExtractor
echo "Building Docker image from project directory..."
echo "Files in this directory:"
ls -la
docker build -t ytextractor:$COMMIT_SHA .
elif [ -f "Dockerfile" ]; then
echo "✅ Found Dockerfile in root directory"
echo "Building Docker image from root..."
elif [ -f "YTExtractor/Dockerfile" ]; then
echo "✅ Found Dockerfile in YTExtractor/ directory"
cd YTExtractor
docker build -t ytextractor:$COMMIT_SHA .
else
echo "❌ Dockerfile not found!"
echo "Searching for Dockerfile..."
find . -name "Dockerfile" -type f
exit 1
fi
# Tag das imagens
# Tag das imagens (voltar para raiz se necessário)
cd /workspace/ricardo/YTExtractor
docker tag ytextractor:$COMMIT_SHA registry.redecarneir.us/ytextractor:latest
docker tag ytextractor:$COMMIT_SHA registry.redecarneir.us/ytextractor:$COMMIT_SHA
@ -115,4 +115,4 @@ jobs:
- name: Verify deployment
run: |
ssh ubuntu@137.131.63.61 'docker ps | grep ytextractor-api'
echo "✅ Deploy completed successfully!"
echo "✅ Deploy completed successfully!"