Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions .gitlab/ci_cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ variables:
- apt-get update && apt-get install -y --no-install-recommends git
script:
- *validate_input
- _ENV_FLAGS="${ENV_FLAGS:=--last-partition --wait}"
- cd $CI_PROJECT_DIR/$DATA_PROJECT_DIR
- _NORMALIZED_BRANCH_NAME=$(echo $DATA_PROJECT_DIR | rev | cut -d "/" -f 1 | rev | tr '.-' '_')
- source .tinyenv

# Create Python Virtual Environment
- python -m venv .venv
Expand All @@ -45,8 +41,28 @@ variables:
# Tinybird version
- tb --version

# Check all the data files syntax
- tb check
# Get changed files
- ALL_CHANGED_FILES=$(git diff --name-only $CI_COMMIT_BEFORE_SHA $CI_COMMIT_SHA | grep -E '.*\.(datasource|incl|pipe)' || true)
- echo "Changed files: $ALL_CHANGED_FILES"

# Check syntax of changed files
- |
for file in $ALL_CHANGED_FILES; do
if [[ $file != *.incl ]]; then
tb check "$file"
fi
done

# Check format of changed files
- |
for file in $ALL_CHANGED_FILES; do
tb fmt --diff "$file"
done

- _ENV_FLAGS="${ENV_FLAGS:=--last-partition --wait}"
- cd $CI_PROJECT_DIR/$DATA_PROJECT_DIR
- _NORMALIZED_BRANCH_NAME=$(echo $DATA_PROJECT_DIR | rev | cut -d "/" -f 1 | rev | tr '.-' '_')
- source .tinyenv

# Check auth
- tb --host $TB_HOST --token $TB_ADMIN_TOKEN auth info
Expand Down
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Next Release (v3.0.0)
=====================
v3.1.0
========

- Add new `check` job in GitHub Actions. It checks syntax and forces format Datafiles so there are no mismatches in the project when working from the UI and git.

v3.0.0
========

- Add `CI_FLAGS` and `CD_FLAGS` env vars to `tb deploy`, they can be defined per Data Project and PR via `.tinyenv`
- Update rollback job to include the `--yes` flag to `tb release rollback`
Expand Down