Ghost/ghost/tinybird/scripts/append_fixtures.sh
Hannah Wolfe e41984d0a5
Initial tinybird setup
ref https://linear.app/tryghost/issue/ANAL-27/setup-tinybird-project-and-cicd

- Tinybird has a system for managing it's configuration as code, with full ci/cd support
- The tinybird CLI tool uses python, so we'll run that using docker, via `yarn tb`
- Some of the files tinybird adds should not be in source control, so we've added those to git ignore
- Everything in /ghost/tinybird is tinybird's init config
2024-08-29 16:56:51 +01:00

22 lines
523 B
Bash
Executable File

#!/usr/bin/env bash
set -euxo pipefail
directory="datasources/fixtures"
extensions=("csv" "ndjson")
absolute_directory=$(realpath "$directory")
for extension in "${extensions[@]}"; do
file_list=$(find "$absolute_directory" -type f -name "*.$extension")
for file_path in $file_list; do
file_name=$(basename "$file_path")
file_name_without_extension="${file_name%.*}"
command="tb datasource append $file_name_without_extension datasources/fixtures/$file_name"
echo $command
$command
done
done