From 4f05516fc2c27bd5aeb54445a89dcfd62fffdbe1 Mon Sep 17 00:00:00 2001 From: Mazyar Date: Tue, 9 Jun 2026 11:29:29 +0330 Subject: [PATCH] Update Drone CI configuration and Makefile to remove legacy worker sources and add build target for worker - Updated `.drone.yml` to remove lingering legacy worker source files after git deletion, ensuring a clean build environment. - Modified `Makefile` to include a new `build-worker` target that removes deprecated scraper and queue source files, streamlining the worker build process. This change enhances the build process by eliminating outdated components and ensuring that the worker is built without legacy dependencies. --- .drone.yml | 2 ++ Makefile | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 2473cd6..905366f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -37,6 +37,8 @@ steps: - go env - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./artifacts/go/bin/web ./cmd/web/main.go - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./artifacts/go/bin/scraper ./cmd/scraper/main.go + # Remove legacy worker sources if they linger on disk after git deleted them (AI pipeline owns scraping now). + - rm -f cmd/worker/workers/scraper.go cmd/worker/workers/scraper_consumer.go cmd/worker/workers/queue_producer.go - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./artifacts/go/bin/worker ./cmd/worker/main.go - cp -r ./cmd/web/docs ./artifacts/go/bin/docs - cp -r ./cmd/web/assets ./artifacts/go/bin/assets diff --git a/Makefile b/Makefile index 661f975..efaa0e9 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Tender Management Backend Makefile -.PHONY: help build run test clean docker-build docker-run docs run-docs +.PHONY: help build build-worker run test clean docker-build docker-run docs run-docs # Default target help: @@ -24,6 +24,14 @@ build: @go build -o bin/web ./cmd/web @echo "Build completed successfully!" +# Build the worker (drops legacy scraper/queue sources removed from git) +build-worker: + @echo "Building worker..." + @rm -f cmd/worker/workers/scraper.go cmd/worker/workers/scraper_consumer.go cmd/worker/workers/queue_producer.go + @mkdir -p bin + @go build -o bin/worker ./cmd/worker + @echo "Worker build completed successfully!" + # Build for macOS (Intel) build-mac: @echo "Building web server for macOS (Intel)..."