Skip to content

feat: Improve API key management #20

feat: Improve API key management

feat: Improve API key management #20

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
jobs:
image:
name: Test Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Split the build into two steps to identify which step fails
- name: Build bundler image
run: docker buildx build --load -t bundler-image:latest ./bundler
- name: Build oba image
run: docker buildx build --load -t oba-image:latest ./oba
services:
name: Test Services
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
# Add test API key to the OBA service
- name: Patch XML
uses: jannekem/run-python-script-action@v1
with:
script: |
import xml.etree.ElementTree as ET
f = './oba/config/onebusaway-api-webapp-data-sources.xml'
ET.register_namespace('', "http://www.springframework.org/schema/beans")
tree = ET.parse(f)
root = tree.getroot()
new_node = ET.Element('bean')
new_node.set('class', 'org.onebusaway.users.impl.CreateApiKeyAction')
property_node = ET.SubElement(new_node, 'property')
property_node.set('name', 'key')
property_node.set('value', 'TEST')
root.append(new_node)
tree.write(f)
- name: Docker Compose up
run: docker-compose up -d
- name: Wait for services to be up
run: sleep 5
- name: Test the services
run: |
chmod +x ./bin/validate.sh
./bin/validate.sh
- name: Docker Compose down
if: always()
run: docker-compose down