-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (46 loc) · 1.66 KB
/
deploy_schedules.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 named schedules
on:
push:
branches: [ main ]
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: |
schedules/*.{yaml,yml}
- name: Deploy named schedules
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
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
echo "$BIGEYE_CONFIG" >> config.ini
echo "$BIGEYE_CREDENTIALS" >> credentials.ini
for file in ${CHANGED_FILES}; do
echo "Creating schedule from ${file}"
schedule_info=$(<"${file}")
sname=$(echo "${schedule_info}" | yq '.schedule_name')
schedule_cron=$(echo "${schedule_info}" | yq '.cron')
bigeye workspace create-named-schedule -b credentials.ini -c config.ini --name "${sname}" --cron "${schedule_cron}"
done