Skip to content

Extract TS BI Server history with CS Tools. #37

Extract TS BI Server history with CS Tools.

Extract TS BI Server history with CS Tools. #37

name:
Extract BI Server with CS Tools.
on:
workflow_dispatch:
schedule:
# Runs every day at 5:15 AM UTC
- cron: "15 5 * * *"
jobs:
extract_data_from_thoughtspot:
# Configure Environment Variables for CS Tools configuration
env:
CS_TOOLS_THOUGHTSPOT__URL: ${{ secrets.THOUGHTSPOT_URL }}
CS_TOOLS_THOUGHTSPOT__USERNAME: ${{ secrets.THOUGHTSPOT_USERNAME }}
CS_TOOLS_THOUGHTSPOT__SECRET_KEY: ${{ secrets.THOUGHTSPOT_SECRET_KEY }}
# CS_TOOLS_TEMP_DIR: ...
runs-on: ubuntu-latest
steps:
- name: Get 7 days ago
run: echo "days_ago_7=$(date -d "-7 days" +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Get 1 days ago
run: echo "days_ago_1=$(date -d "-1 days" +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Check out the repository main branch
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install a specific version of CS Tools
run: python -m pip install -e .[cli]
# --config ENV: tells CS Tools to pull the information from environment variables.
- name: Grab N-7 to N-1 days of BI Server Data
run: "cs_tools tools searchable bi-server --from-date $days_ago_7 --to-date $days_ago_1 --syncer ${{ secrets.SYNCER_DECLARATIVE_STRING }} --config ENV:"