-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (46 loc) · 1.57 KB
/
deploy_virtual_tables.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Deploy virtual tables
on:
push:
branches: [ main ]
paths: [ virtual_tables/** ]
env:
BIGEYE_CREDENTIALS: ${{ secrets.BIGEYE_API_CREDENTIALS }}
BIGEYE_CONFIG: ${{ secrets.BIGEYE_API_CONFIGS }}
jobs:
deploy_virtual_tables:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9" ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Verify Changed files
uses: tj-actions/changed-files@v44
id: verify-changed-files
with:
files: |
virtual_tables/**/*.{yaml,yml}
- name: Deploy virtual tables
if: steps.verify-changed-files.outputs.any_changed == 'true'
env:
CHANGED_FILES: ${{ steps.verify-changed-files.outputs.all_changed_files }}
run: |
python -m pip install --upgrade pip
python -m pip install bigeye-cli
echo "$BIGEYE_CONFIG" >> config.ini
echo "$BIGEYE_CREDENTIALS" >> credentials.ini
for file in ${CHANGED_FILES}; do
echo "Virtual table upsert for ${file}"
vtn=$(cat ${file} | yq '.table_name')
sn=$(cat ${file} | yq '.source_name')
sql=$(cat ${file} | yq '.sql')
bigeye catalog upsert-virtual-table --bigeye_conf credentials.ini --config_file config.ini -vtn "${vtn}" -sn "${sn}" --sql "${sql}"
done