{"id":13675805,"url":"https://github.com/tinybirdco/ci","last_synced_at":"2025-05-05T21:40:36.516Z","repository":{"id":160864279,"uuid":"635660851","full_name":"tinybirdco/ci","owner":"tinybirdco","description":"Collection of configuration files that enable CI flows for Tinybird projects","archived":false,"fork":false,"pushed_at":"2025-02-03T10:05:14.000Z","size":401,"stargazers_count":3,"open_issues_count":6,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-28T10:17:18.972Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinybirdco.png","metadata":{"files":{"readme":".gitlab/README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-03T07:19:34.000Z","updated_at":"2025-02-18T17:00:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"dfb4d7bc-5232-4217-8f7c-c2da2d892151","html_url":"https://github.com/tinybirdco/ci","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinybirdco","download_url":"https://codeload.github.com/tinybirdco/ci/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252581682,"owners_count":21771552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T12:01:03.730Z","updated_at":"2025-05-05T21:40:36.484Z","avatar_url":"https://github.com/tinybirdco.png","language":"Shell","readme":"# Iterating your Tinybird data projects with a GitLab repository\n\nFollow the [`Working with version control`](https://www.tinybird.co/docs/production/working-with-version-control) guide, which explains how to set up your GitLab CI for iterating your Tinybird data project.\n\nTL;DR: run `tb init --git` from your main git branch, making sure the command succeeds.\n\nA new ENV variable `TB_ADMIN_TOKEN` will be needed in your repository.\n\n\u003e Visit `Settings \u003e\u003e CI/CD \u003e\u003e Variables` section, and \"Add variable\" \n\nIt's recommended that you build your CI/CD pipeline based on our [ci_cd.yaml](https://github.com/tinybirdco/ci/blob/main/.gitlab/ci_cd.yml) template file.\n\nIf you want to include the provided `ci_cd.yaml` template into your GitLab pipeline you can include these lines in your `.gitlab_ci.yml` file:\n\n```yml\n# include latest release, to avoid the dependency you can just copy the jobs and paste them into your GitLab pipeline, it's just tinybird-cli commands and shell script\ninclude: \"https://raw.githubusercontent.com/tinybirdco/ci/v4.0.1/.gitlab/ci_cd.yaml\"\n\nvariables:\n  # User your Tinybird API region endpoint: https://www.tinybird.co/docs/api-reference/overview#regions-and-endpoints\n  # You can copy it from the region drop down in the Tinybird UI\n  TB_HOST: \"https://api.tinybird.co\"\n  TB_ADMIN_TOKEN: $TB_ADMIN_TOKEN\n  # this is the folder where your Tinybird data project is, change it to your folder. If it's in the root just use '.'\n  DATA_PROJECT_DIR: tinybird\n\ndeploy_ci:\n  extends: .tb_deploy_ci\n  rules:\n    # runs on merge request: it creates a new Tinybird Branch and deploy changed Datafiles (obtained with a git diff)\n    - if: $CI_MERGE_REQUEST_ID\n      changes:\n        # These are references to the DATA_PROJECT_DIR, change them accordingly\n        - tinybird/*\n        - tinybird/**/*\n\ntest_ci:\n  extends: .tb_test\n  needs: [\"deploy_ci\"]\n  rules:\n    # runs on merge request: it runs tests if any in the MR\n    - if: $CI_MERGE_REQUEST_ID\n      changes:\n        - tinybird/*\n        - tinybird/**/*\n\ncleanup_ci:\n  extends: .tb_cleanup_ci_branch\n  rules:\n    # runs on merge, it removes the temporary Tinybird Branch\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n      when: always\n      changes:\n        - tinybird/*\n        - tinybird/**/*\n\ndeploy_main:\n  extends: .tb_deploy_main\n  rules:\n    # runs on merge: Runs the same deployment as `deploy_ci` but in the main Workspace instead of a Tinybird Branch\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n      changes:\n        - tinybird/*\n        - tinybird/**/*\n```\n\n\n## Snippets\n\nThese are some snippets to include in your GitLab CI configuration file for improving your developer experience:\n\n### Pre-commit formatting\n\n```yml\npre-commit:\n  stage: test\n  image: registry.gitlab.com/winny/pre-commit-docker:latest\n  variables:\n    PRE_COMMIT_HOME: .pre-commit-cache\n  cache:\n    - key:\n        files: [.pre-commit-config.yaml]\n      paths: [.pre-commit-cache]\n  script:\n    - tb fmt --yes --line-length 100\n```\n","funding_links":[],"categories":["SDKs \u0026 Utilities 🧰"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinybirdco%2Fci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fci/lists"}