Check if RIO queue is up or down #912
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
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 |