-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_pipeline.bat
More file actions
46 lines (37 loc) · 1.13 KB
/
Copy pathrun_pipeline.bat
File metadata and controls
46 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@echo off
SETLOCAL EnableDelayedExpansion
REM Set paths
SET "SCRIPT_DIR=
SET "PYTHON_PATH=
SET "LOG_FILE=%SCRIPT_DIR%\LOGS\pipeline_execution.log"
SET "TRACKING_DB=%SCRIPT_DIR%\file_tracking.db"
REM Header
echo ============================================== >> "%LOG_FILE%"
echo Starting pipeline execution at %date% %time% >> "%LOG_FILE%"
echo ============================================== >> "%LOG_FILE%"
REM Run the main orchestration script
SET "MAIN_SCRIPT=%SCRIPT_DIR%\src\main.py"
if not exist "!MAIN_SCRIPT!" (
echo ERROR: main.py not found at !MAIN_SCRIPT!
echo ERROR: main.py not found at !MAIN_SCRIPT! >> "%LOG_FILE%"
goto :ERROR
)
REM Change to the correct working directory
cd /d "%SCRIPT_DIR%"
echo Running complete ETL pipeline...
"%PYTHON_PATH%" "!MAIN_SCRIPT!" >> "%LOG_FILE%" 2>&1
IF !ERRORLEVEL! NEQ 0 (
echo ERROR: Pipeline failed with exit code !ERRORLEVEL!
goto :ERROR
) else (
echo Pipeline executed successfully!
)
goto :END
:ERROR
echo.
echo Pipeline execution completed with errors at %date% %time%
exit /b 1
:END
echo.
echo Pipeline execution completed successfully at %date% %time%
exit /b 0