26 lines
1.0 KiB
Bash
Executable File
26 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# main.sh — pipeline caller
|
|
# Runs each R script in order via the rstudio Docker container.
|
|
# Equivalent to a PowerShell script that calls macros sequentially.
|
|
#
|
|
# To schedule this automatically, add a cron entry:
|
|
# 0 8 * * 1 /data/projects/r/powershell_example/main.sh >> /tmp/pipeline.log 2>&1
|
|
# That runs the pipeline every Monday at 8am.
|
|
|
|
set -e # stop on any error
|
|
|
|
WORKDIR="/data/projects/r/powershell_example"
|
|
|
|
echo "=== Pipeline start: $(date) ==="
|
|
|
|
docker exec -w "$WORKDIR" rstudio Rscript scripts/01_create_data.R
|
|
docker exec -w "$WORKDIR" rstudio Rscript scripts/02_validate.R
|
|
docker exec -w "$WORKDIR" rstudio Rscript scripts/03_convert_currency.R
|
|
docker exec -w "$WORKDIR" rstudio Rscript scripts/04_pivot_income.R
|
|
docker exec -w "$WORKDIR" rstudio Rscript scripts/05_convert_units.R
|
|
docker exec -w "$WORKDIR" rstudio Rscript scripts/06_merge.R
|
|
docker exec -w "$WORKDIR" rstudio Rscript scripts/07_calc.R
|
|
docker exec -w "$WORKDIR" rstudio Rscript scripts/08_format.R
|
|
|
|
echo "=== Pipeline complete: $(date) ==="
|