-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (45 loc) · 1.72 KB
/
daily-dci.yml
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
57
58
name: Daily DCI Update
on:
schedule:
# weekly
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
weekly-query:
runs-on: ubuntu-22.04
env:
SHELL: /bin/bash
NUM_DAYS: 7
steps:
- name: Install the JQ package
run: sudo apt-get install jq -y
- name: Clone the telco-bot repository
uses: actions/checkout@v4
# Clone the go-dci repository
- name: Checkout go-dci
uses: actions/checkout@v4
with:
repository: 'sebrandon1/go-dci'
path: go-dci
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Build the go-dci project
run: go build
working-directory: go-dci
- name: Set the config file via the go-dci project
run: ./go-dci config set --accesskey=${{ secrets.DCI_ACCESS_KEY }} --secretkey=${{ secrets.DCI_SECRET_KEY }}
working-directory: go-dci
- name: Run the go-dci project and collect the JSON output
run: ./go-dci jobs -d ${{ env.NUM_DAYS }} --output=json > ${GITHUB_WORKSPACE}/dci-output.json
working-directory: go-dci
- name: Run the go-dci project and collect the ocpVersion output
run: ./go-dci ocpcount -d ${{ env.NUM_DAYS }} --output=json > ${GITHUB_WORKSPACE}/dci-ocpversion.json
working-directory: go-dci
- name: Print the JSON output
run: cat ${GITHUB_WORKSPACE}/dci-output.json
- name: Print the ocpVersion output
run: cat ${GITHUB_WORKSPACE}/dci-ocpversion.json
- name: Parse the JSON output and print the results
run: ./scripts/send-slack-msg.sh ${{ secrets.SLACK_WEBHOOK_URL }} dci-output.json dci-ocpversion.json ${{ env.NUM_DAYS }}