Skip to content

Commit

Permalink
Merge pull request #388 from ral-facilities/feature/use-yaml-config#372
Browse files Browse the repository at this point in the history
Feature/use yaml config#372
  • Loading branch information
Reillyhewitson authored Nov 22, 2022
2 parents 57edaaa + 5a63e70 commit 5060d5e
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 113 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ jobs:
- name: Create log file
run: touch logs.log
- name: Configure log file location
run: echo "`jq -r --arg REPO_DIR "$GITHUB_WORKSPACE/logs.log" \
'.log_location=$REPO_DIR' datagateway_api/config.json.example`" > datagateway_api/config.json.example
- name: Create config.json
run: cp datagateway_api/config.json.example datagateway_api/config.json
run: echo "`yq \
'.log_location="${GITHUB_WORKSPACE}/logs.log"' datagateway_api/config.yaml.example | envsubst`" > datagateway_api/config.yaml.example
- name: Configure datagateway extension
run: echo "`yq \
'.datagateway_api.extension="/datagateway_api"' datagateway_api/config.yaml.example`" > datagateway_api/config.yaml.example
- name: Create config.yaml
run: cp datagateway_api/config.yaml.example datagateway_api/config.yaml
- name: Create search_api_mapping.json
run: cp datagateway_api/search_api_mapping.json.example datagateway_api/search_api_mapping.json

Expand Down Expand Up @@ -245,10 +248,10 @@ jobs:
- name: Checkout DataGateway API
uses: actions/checkout@v2

- name: Create config.json
run: cp datagateway_api/config.json.example datagateway_api/config.json
- name: Create config.yaml
run: cd /home/runner/work/datagateway-api/datagateway-api; cp datagateway_api/config.yaml.example datagateway_api/config.yaml
- name: Create search_api_mapping.json
run: cp datagateway_api/search_api_mapping.json.example datagateway_api/search_api_mapping.json
run: cd /home/runner/work/datagateway-api/datagateway-api; cp datagateway_api/search_api_mapping.json.example datagateway_api/search_api_mapping.json
- name: Install Poetry
run: pip install poetry==1.1.9

Expand Down Expand Up @@ -299,10 +302,10 @@ jobs:
with:
ref: ${{ github.event.repository.default_branch }}

- name: Create config.json
run: cp datagateway_api/config.json.example datagateway_api/config.json
- name: Create config.yaml
run: cd /home/runner/work/datagateway-api/datagateway-api; cp datagateway_api/config.json.example datagateway_api/config.json
- name: Create search_api_mapping.json
run: cp datagateway_api/search_api_mapping.json.example datagateway_api/search_api_mapping.json
run: cd /home/runner/work/datagateway-api/datagateway-api; cp datagateway_api/search_api_mapping.json.example datagateway_api/search_api_mapping.json

# Installing an older version of setuptools for reasons explained at: https://github.com/icatproject/python-icat/issues/99
- name: Uninstall setuptools
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ venv/
*.pyc
logs.log*
config.json*
config.yaml
search_api_mapping.json*
.vscode/
.nox/
Expand Down
Loading

0 comments on commit 5060d5e

Please sign in to comment.