Skip to content

Commit

Permalink
Attempt to use api dev_cli script to setup mongodb #499
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvdavies committed Apr 15, 2024
1 parent 914c35f commit 37f061f
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,6 @@ jobs:
runs-on: ubuntu-latest

services:
mongodb:
image: mongo:7.0-jammy
ports:
- 27017:27017
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example

ims-api:
image: harbor.stfc.ac.uk/inventory-management-system/ims-api:develop
ports:
Expand All @@ -103,6 +95,23 @@ jobs:
options: --name inventory-management-system-api

steps:
- name: Clone api repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
name: ral-facilities/inventory-management-system-api
ref: add-common-dev-task-script-#235

- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.12'
cache: 'pip'

- name: Setup MongoDB
run: |
python ./scripts/dev_cli.py db-init --replicaSetMemberHost localhost
python ./scripts/dev_cli.py db-import
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

Expand All @@ -117,12 +126,6 @@ jobs:
sudo apt-get install libgconf-2-4
yarn --immutable
- name: Download unit data
run: wget https://raw.githubusercontent.com/ral-facilities/inventory-management-system-api/develop/data/units.json

- name: Import unit data to ims api
run: docker exec -i $(docker ps | grep mongo | awk '{ print $1 }') mongoimport --username 'root' --password 'example' --authenticationDatabase=admin --db ims --collection units --type=json --jsonArray --drop < units.json

- name: Run e2e tests
run: yarn e2e:api

Expand Down

0 comments on commit 37f061f

Please sign in to comment.