🔧 fix: optimize Docker cache usage by removing redundant go mod tidy
- Remove unnecessary go mod tidy execution when using Docker cache - Dependencies are already pre-installed in the cache image - Only run go mod tidy when not using cache (native execution) - This leverages the true purpose of the Docker build cache Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -85,16 +85,16 @@ else
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# 5. Install dependencies
|
||||
echo "5. Installing dependencies..."
|
||||
# 5. Check dependencies
|
||||
echo "5. Checking dependencies..."
|
||||
if [ "$USE_DOCKER_CACHE" = true ]; then
|
||||
echo "Running in Docker Compose container..."
|
||||
docker compose -f docker-compose.build.yml exec -w /workspace build-cache sh -c "go mod tidy"
|
||||
echo "✅ Using pre-installed dependencies from Docker cache"
|
||||
# No need to run go mod tidy - dependencies are already in the cache
|
||||
else
|
||||
echo "Running natively..."
|
||||
echo "Running natively - ensuring dependencies are up to date..."
|
||||
go mod tidy
|
||||
fi
|
||||
echo "✅ Dependencies installed"
|
||||
echo "✅ Dependencies ready"
|
||||
echo ""
|
||||
|
||||
# 6. Generate Swagger Docs
|
||||
|
||||
Reference in New Issue
Block a user