-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (82 loc) · 3.73 KB
/
test-rio.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Check if RIO queue is up or down
on:
schedule:
# every hour on weekdays during working hours, 9:06 tm 16:06
# may be shifted an hour in late March and October, but that's not a big deal
- cron: '6 8-15 * 1,2,3,11,12 1-5' # Winter time CET (UTC+1).
- cron: '6 7-14 * 4-10 1-5' # Summer time CET (UTC+2)
jobs:
rio_queue:
runs-on: ubuntu-latest
steps:
- name: Get status of previous run of this workflow - store in last_status
uses: Mercymeilya/last-workflow-status@v0.3.3
id: last_status
- name: Cache lein project dependencies
uses: actions/cache@v4
with:
path: "~/.m2/repository"
key: "${{ runner.os }}-clojure-${{ hashFiles('**/project.clj') }}"
- name: Checkout code
uses: actions/checkout@v4
- name: Setup certificate stores
env:
KEYSTORE_JKS_B64: ${{ secrets.KEYSTORE_JKS_B64 }}
TRUSTSTORE_JKS_B64: ${{ secrets.TRUSTSTORE_JKS_B64 }}
run: |
echo "$KEYSTORE_JKS_B64" | base64 -d > keystore.jks
echo "$TRUSTSTORE_JKS_B64" | base64 -d > truststore.jks
- name: Check rio queue status
env:
CLIENTS_INFO_PATH: ${{ secrets.CLIENTS_INFO_PATH }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
GATEWAY_PASSWORD: ${{ secrets.GATEWAY_PASSWORD }}
GATEWAY_ROOT_URL: ${{ secrets.GATEWAY_ROOT_URL }}
GATEWAY_USER: ${{ secrets.GATEWAY_USER }}
KEYSTORE: keystore.jks
KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
OS_AUTH_URL: ${{ secrets.OS_AUTH_URL }}
OS_CONTAINER_NAME: ${{ secrets.OS_CONTAINER_NAME }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
RIO_READ_URL: ${{ secrets.RIO_READ_URL }}
RIO_RECIPIENT_OIN: ${{ secrets.RIO_RECIPIENT_OIN }}
RIO_SENDER_OIN: ${{ secrets.RIO_SENDER_OIN }}
RIO_RETRY_ATTEMPTS_SECONDS: '5,10,15'
RIO_UPDATE_URL: ${{ secrets.RIO_UPDATE_URL }}
SLACK_URL: ${{ secrets.SLACK_URL }}
STORE_HTTP_REQUESTS: true
SURF_CONEXT_CLIENT_ID: ${{ secrets.SURF_CONEXT_CLIENT_ID }}
SURF_CONEXT_CLIENT_SECRET: ${{ secrets.SURF_CONEXT_CLIENT_SECRET }}
SURF_CONEXT_INTROSPECTION_ENDPOINT: ${{ secrets.SURF_CONEXT_INTROSPECTION_ENDPOINT }}
TOKEN_ENDPOINT: ${{ secrets.TOKEN_ENDPOINT }}
TRUSTSTORE: truststore.jks
TRUSTSTORE_PASSWORD: ${{ secrets.TRUSTSTORE_PASSWORD }}
id: test_rio
run: |
lein mapper test-rio rio-mapper-dev.jomco.nl
echo "ERROR_STATUS=$?" >> "$GITHUB_OUTPUT"
continue-on-error: true
- name: Notify ok only if previous run failed.
env:
SLACK_URL: ${{ secrets.SLACK_URL }}
if: ${{ steps.test_rio.outputs.ERROR_STATUS == 0 && steps.last_status.outputs.last_status != 'success' }}
run: |
curl -q -H "Content-Type: application/json" -X POST -d '{"text": "RIO Queue is finally UP"}' $SLACK_URL
- name: Notify queue down
env:
SLACK_URL: ${{ secrets.SLACK_URL }}
if: ${{ steps.test_rio.outputs.ERROR_STATUS == -1 }}
run: |
curl -q -H "Content-Type: application/json" -X POST -d '{"text": "RIO Queue is DOWN"}' $SLACK_URL
exit 1
- name: Notify error
env:
SLACK_URL: ${{ secrets.SLACK_URL }}
if: ${{ steps.test_rio.outputs.ERROR_STATUS == -2 }}
run: |
curl -q -H "Content-Type: application/json" -X POST -d '{"text": "Error while checking RIO Queue"}' $SLACK_URL
exit 1