Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #50 from nhsuk/bug/missing-env
Browse files Browse the repository at this point in the history
🐛 ensure required etl-toolkit env is set
  • Loading branch information
beseven authored May 3, 2018
2 parents 007df9c + 78cce20 commit ca75de0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.8.1 / 2018-05-04
==================
- Add require enviroment var check for OUTPUT_FILE, update rancher config

0.8.0 / 2018-05-01
==================
- Refresh all records nightly to ensure removed/added records are picked up
Expand Down
2 changes: 1 addition & 1 deletion app/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
containerName: process.env.CONTAINER_NAME || 'etl-output',
orgApiUrl: 'https://api.nhs.uk/organisations',
outputDir: './output',
outputFile: process.env.OUTPUT_FILE || 'pharmacy-data',
outputFile: process.env.OUTPUT_FILE,
syndicationApiUrl: 'https://v1.syndication.nhschoices.nhs.uk/organisations/pharmacies',
version,
};
2 changes: 2 additions & 0 deletions app/lib/smartEtl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const moment = require('moment');
const requireEnv = require('require-environment-variables');

const etlStore = require('etl-toolkit').etlStore;
const getModifiedOdsCodes = require('./actions/getModifiedOdsCodes');
Expand All @@ -16,6 +17,7 @@ let dataService;
let startMoment;
let lastRunDate;

requireEnv(['OUTPUT_FILE']);
etlStore.setIdKey(RECORD_KEY);

function clearState() {
Expand Down
2 changes: 2 additions & 0 deletions docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
- pharmacy-etl-test-node_modules:/code/node_modules
environment:
NODE_ENV: development
OUTPUT_FILE: test-pharmacy-data

test-ci:
extends:
Expand All @@ -21,6 +22,7 @@ services:
- pharmacy-etl-test-node_modules:/code/node_modules
environment:
COVERALLS_REPO_TOKEN: ${COVERALLS_REPO_TOKEN}
OUTPUT_FILE: ci-pharmacy-data
NODE_ENV: development
TRAVIS: ${TRAVIS}
TRAVIS_BRANCH: ${TRAVIS_BRANCH}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pharmacy-data-etl",
"version": "0.8.0",
"version": "0.8.1",
"description": "ETL to extract data from Syndication/Organisations and store as JSON",
"main": "app.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions rancher-config/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
SYNDICATION_API_KEY: ${SYNDICATION_API_KEY}
DISABLE_SCHEDULER: ${DISABLE_SCHEDULER}
ETL_SCHEDULE: ${ETL_SCHEDULE}
OUTPUT_FILE: pharmacy-data
NODE_ENV: production
labels:
io.rancher.container.pull_image: always
Expand Down

0 comments on commit ca75de0

Please sign in to comment.